Simple enoough problem …PhysicsCharacterNode using a SphereCollisionShape for it’s bounds is moving through a MeshCollisionShape.
The MeshCollisionShape is the terrain.
The PhysicsCharacterNode is the character.
Whenever the character reaches a triangle/quad in the terrain that is between 45 and 90 degrees with the one it’s on, something squiffy happens and the character falls through the terrain.
My suspicion is that the force from the rebound is being applied (character bouncing off the terrain) and then the gravity is applied and the player is pushed through the terrain …then the unstoppable descent begins.
So really I have two questions:
Is there something that I can do with the physics that’ll fix this in jbullet-jme for jME2.
Ah, it’s taken a while but I’ve found some time to look into this some more.
@normen, thanks for that idea, gave it a try and although things improved, they did so only slightly, still get some triangles of the terrain which the character falls through.
Interesting having overriden the broadphase handle, I can tell what the problem is, but no idea how it’s being caused.
As I recall bullets collision detection pipeline goes through the broadphase where it checks the loose fitting shapes (say AABB), then if they are in collision things progress to the narrow phase.
What I’m seeing is that for some of the triangles there is no broadphase collision event (I’m seeing the character sphere and terrain mesh via the PhysicsDebugger), so for those triangles there is no call to the method
[java] public boolean needBroadphaseCollision( BroadphaseProxy proxyA, BroadphaseProxy proxyB )
Any thoughts on how the broadphase check can be being skipped?