Missing normalisation in btRaycastVehicle

Post Reply
Posts: 83
Joined: Tue Oct 24, 2006 11:52 pm
Location: Australia

Missing normalisation in btRaycastVehicle

Post by hiker »


I've just spent some time debugging a bullet problem - when falling down on one particular spot the kart would be shot up high into the sky. Reason is that m_hitNormalInWorld in btVehicleRaycasterResult is not normalised. While I knew that this value is not normalised (I normalise it in my code when using it), the problem is that this value is actually used without normalisation in btRaycastVehicle:

Code: Select all

                wheel.m_raycastInfo.m_contactNormalWS  = rayResults.m_hitNormalInWorld;
                btVector3 impulse = wheel.m_raycastInfo.m_contactNormalWS * suspensionForce * step;
Normalising m_contactNormalWS fixed the problem for us, but I think it would be good to fix this in bullet as well. I guess the reason that this only happens at one spot is that the triangle the kart was falling on is big.

Now we have used the code without normalisation for years now, and never noticed a problem - were we just lucky (in that we apparently never fell onto a big triangle)? Or are we perhaps introducing some kind of problem with the normalisation?

Post Reply