After much experimentation and a bit of sifting through jME Physics code, I think I have a rough understanding of how to use the collision physics. The issue I ran into was that my marble was rolling on Sphere and Box objects but passing through all the other jME primitive shapes I tried.
Apparently, method PhysicsNode.generatePhysicsGeometry creates the invisible physical boundary of the node based on the associated geometric shape. Calling generatePhysicsGeometry with no argument essentially tells it to use specially optimized boundaries for better collision functionality performance. The trouble is that these high-performance boundaries only works for boxes, spheres, and terrain (I haven't tried this last one yet but the code suggests that it works).
For any other object be treated as solid, the useTriangleAccurateGeometries argument of method PhysicsNode.generatePhysicsGeometry must be set to true. Comments in the jME Physics code state that there's a performance hit. But at least it works.

No comments:
Post a Comment