No CCD with triangle mesh with existing contacts

Eric_A
Posts: 6
Joined: Wed May 06, 2009 4:42 am

No CCD with triangle mesh with existing contacts

Post by Eric_A »

A big problem we're having is tunneling through the BVH triangle mesh that we're using for terrain and fixed objects when an object is moving fast. I've tried turning on CCD for the player's rigid body, but after looking into the CCD code I've found that it does not perform the CCD for any rigid bodies that already have contact points with each other. This is a problem because our entire terrain is one btBvhTriangleMeshShape (though it consists of many sub-meshes), so the player always has at least one contact (the ground) with the triangle mesh. Thus, CCD is never enabled between the player and the environment, so they can go through walls and collision boundaries when doing fast movements such as a slide.

Would it cause any foreseeable problems to not check for contact points if the object being tested against is a triangle mesh? Is there a better solution for this kind of scenario?

Edit: I tried having it not check for existing contacts with triangle meshes, and it doesn't work since our players' centers of mass is at their feet, since the CCD sweep test will always return true for the ground and results in constant motion clamping when the player tries to run. How can we get around this limitation?