Destroyed Raycast Vehicle

MonkeyTank
Posts: 10
Joined: Thu Oct 08, 2009 6:57 pm

Destroyed Raycast Vehicle

Post by MonkeyTank »

Hi,
Let me first say that although I am rather new to bullet I really love it.

With that said, on to my problem:
I have a tank game.
In the game, all vehicles are raycast vehicles.
Currently, when I destroy an enemy vehicle via gun fire I apply brakes and zero out engine force to the destroyed vehicle.
Is their any better way of doing this?

Thanks
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Destroyed Raycast Vehicle

Post by Erwin Coumans »

MonkeyTank wrote: With that said, on to my problem:
I have a tank game.
In the game, all vehicles are raycast vehicles.
Currently, when I destroy an enemy vehicle via gun fire I apply brakes and zero out engine force to the destroyed vehicle.
Is their any better way of doing this?

Thanks
This sounds reasonable.

Alternatively, you could also just remove the btRayCastVehicle action from the world and replace it by actual static rigid body wheels. This way, it doesn't consume any CPU cycles anymore (without the btRayCastVehicle action, the chassis will just fall down as if no wheels exist).

Thanks,
Erwin