Basically, while creating a "sensor" type object I noticed that my vehicles were sometimes colliding with the sensor body. For example, while driving on a curved surface I would hit a static plane sensor even though it was set to no contact response. The body of the kart would go through it no problem but sometimes the wheels would seem to "catch" onto to the plane.
After a bit of thinking I realized that the btDefaultVehicleRaycaster doesn't check if the body that is casted against has contact response enabled.
The fix is very simple:
Old code:
Code: Select all
if (rayCallback.hasHit())
{
btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
if (body)
Code: Select all
if (rayCallback.hasHit())
{
btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
if (body && body->hasContactResponse())
Thanks.