I need to determine the nearest vertex of a collision (from a mouse click ray collision) on a large geomnode with 20-25,000 vertices. (Ultimately, I need to identify the polygon face on which the mouse click occurred.)
This is for a mostly flat ‘terrain like’ surface where the user has an overhead cam view. Since most collisions, it seems, involves objects of a certain general shape, I’m not sure how to approach this problem for a mostly-flat plane. I thought about a CollisionPlane, but I’m not sure how that would play out for parts of the ‘terrain’ that are at a much higher z position than the plane. I’m fairly sure that clicking on “high” mountain or hill areas would result in collisions far behind the actual poly face.
Anyone have any ideas for a strategy?
Here’s a past thread wih some more info about the project requirements if useful: discourse.panda3d.org/viewtopic.php?t=9214
I found a sort of similar post here but there isn’t much to read:
discourse.panda3d.org/viewtopic … c8bce4ae6f
I’m not optimistic about following the suggestion there, which in my case would mean creating up to 25,000 CollisionPolygon solids for each face, and I imagine Python (maybe even C++) choking on that request given that they are the “most expensive” to use. Perhaps through some miracle this isn’t the case?