Cobra wrote:
I have the filters so that the vehicle collides with terrain, and the terrain collides with vehicles, so why wouldn't the raycast vehicle work at all? I've looked through the source files of the raycast vehicle but can't find any mention of filters, so it must be in the rigid body or collision object's code.
First of all, I've never tried to use raycast
vehicles + collision masks myself.
Anyway I believe that raycasts can be done with collision masks themselves in this way (note: this is a generic raycast, not specific to raycast
vehicles; also this code is a bit old, I hope it works):
Code:
btCollisionWorld::ClosestRayResultCallback rayCallback(rayFrom,rayTo);
m_dynamicsWorld->rayTest(rayFrom,rayTo,rayCallback);
rayCallback.m_collisionFilterMask = btBroadphaseProxy::AllFilter & ~btBroadphaseProxy::SensorTrigger;
if (rayCallback.hasHit())
{
btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
[...]
}
The filters are present in the line:
Code:
rayCallback.m_collisionFilterMask = btBroadphaseProxy::AllFilter & ~btBroadphaseProxy::SensorTrigger;
I would try to apply filters both to the car chassis and to raycasts.
Hope it helps.