btRaycastVehicle wheels falling through the terrain

Yanush
Posts: 5
Joined: Wed Jun 25, 2008 3:51 pm

btRaycastVehicle wheels falling through the terrain

Post by Yanush »

Hello, as the subject says, I'm encountering a problem of btRaycastVehicle's wheels (i.e. the "rays" which are cast to test if the car touches the ground) pass through the terrain during fast turns, which in turn results in chasis hitting the ground as well. Does anyone know how to resolve this problem and make sure that the "wheels" do not fall through?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btRaycastVehicle wheels falling through the terrain

Post by Erwin Coumans »

Yanush wrote:Hello, as the subject says, I'm encountering a problem of btRaycastVehicle's wheels (i.e. the "rays" which are cast to test if the car touches the ground) pass through the terrain during fast turns, which in turn results in chasis hitting the ground as well. Does anyone know how to resolve this problem and make sure that the "wheels" do not fall through?

Did you make sure the ray starts inside the chassis? Have you tried to visually debug/analyse the problem, using the debug drawing? You can derive your own version of btIDebugDraw, see Demos/OpenGL/GLDebugDrawer.cpp for example.

Hope this helps,
Erwin
Yanush
Posts: 5
Joined: Wed Jun 25, 2008 3:51 pm

Re: btRaycastVehicle wheels falling through the terrain

Post by Yanush »

I tried the debug draw and it seemed OK to me, although I could be wrong.

But, it seems like it has to do with gMaxSuspensionForce being capped at 6000, inside btRaycastVehicle::updateVehicle, it would appear that on sharp turns the car gets pressed into the ground by the centripetal force so much that the suspension reaches that 6000 and gives in, increasing that value basically solved it for me, the car stopped falling through at the speeds I care about.