Fast moving bodies and tunneling

Post Reply
note173
Posts: 16
Joined: Wed Jan 25, 2012 6:32 pm

Fast moving bodies and tunneling

Post by note173 »

My word contains a vehicle (joint-based, 2 wheels) and a character (driving the vehicle). The character is a ragdoll with spring motors. Ground and obstacles are triangle meshes (btBvhTriangleMeshShape). It's a driving game.
The is a lot of problems, actually; the biggest is well-known fast body tunneling. Relatively small objects that form the ragdoll suffer
I can't turn CCD on, the hardware is a bit slow for it (smartphones and tablets). I can't increase simulation frequency either.
But the dynamic body count isn't that big. Can I manually check somehow after each physics tick for penetrations?
kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Fast moving bodies and tunneling

Post by kloplop321 »

Do you mean tunneling like part of the object is in and the other is not?
I think I have a solution for you if it's simple enough, set up a periodic check, let's say 5 times a second
Now each time record the current position, and the linear velocity.
Now cast a ray from the last position to the current position. If you have any results except for the actual vehicle and ragdoll, then do a check with a ghost body.
If your ghost body it can be a capsule(fast to compute, make it small it should not be touching the ground), at the current time, is in collision with a static object(such as the ground) then set the position to the last known position(should be good) and change the velocity so it does not happen again.


I hope I made sense.
Post Reply