setting collision flags on the rigid body of my vehicle

miranlp
Posts: 3
Joined: Wed May 12, 2010 8:25 pm

setting collision flags on the rigid body of my vehicle

Post by miranlp »

Hey!

Quick question here. I'm using btRaycastVehicle and everything is working fine and now I'd like to add some sounds when the car's rigid body collides with the track. The track is implemented with a btBvhTriangleMeshShape.

I follow the example in this post and set a collision flag between the rigid body of my vehicle and the rigid body of the track:

Code: Select all

world.vehicle->getRigidBody()->setCollisionFlags(groundRigidBody->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
But when I do this, my vehicle doesn't move anywhere, it's like the raycasting stops working. Even if I start the car above the track, it doesn't fall down, it just stays in the air. I can turn the wheels however. Does anyone know why this happens? I'd just like to implement my custom gContactAddedCallback so that I can check when my car's chassis collides with the track triangle mesh and trigger sounds from there.

Any help is appreciated!