Single-sided collision response with btBvhTriangleMeshShapes
Posted: Sun Mar 21, 2010 11:37 pm
When a rigid body collides with a btBvhTriangleMesh shape, the collision response seems to ignore the orientation of the triangle face (i.e. clockwise or counter-clockwise), and instead, determine which direction to move based on whichever side is closer. This means that if a sphere of diameter 1 is penetrating a btBvhTriangleMesh with depth greater than 0.5, the collision response will push it all the way into the mesh and keep it trapped there. Similarly, if an articulated system like a ragdoll collides with the btBvhTriangleMesh, some of the parts could be pushed inwards while the others are pushed outwards, resulting in an unfixable situation in which the system is stuck halfway into the mesh -- for example, a character's legs might be stuck in the mesh, while the torso is outside.
To fix this, we can use the orientation of each triangle face to determine which direction is 'out' regardless of which one is closer. This way, even if a sphere of diameter 1 is penetrating a wall to a depth of 0.99, it would be correctly pushed out. Similarly, a ragdoll could never be stuck half-in and half-out -- the penetrating bodies would collide with the surface and be pushed out in the correct direction.
Is there any way to enable this kind of behavior? This was the default triangle mesh collision response in ODE, and seems like it must at least be an option in Bullet.
To fix this, we can use the orientation of each triangle face to determine which direction is 'out' regardless of which one is closer. This way, even if a sphere of diameter 1 is penetrating a wall to a depth of 0.99, it would be correctly pushed out. Similarly, a ragdoll could never be stuck half-in and half-out -- the penetrating bodies would collide with the surface and be pushed out in the correct direction.
Is there any way to enable this kind of behavior? This was the default triangle mesh collision response in ODE, and seems like it must at least be an option in Bullet.