Advertisement

bullet raycast vehicle - compound shape and center of the gravity/mass

Started by November 12, 2019 10:07 PM
0 comments, last by Irbis_88 5 years, 2 months ago

I use btBoxShape as a collision shape for a chassis rigid body (raycast vehicle). An initial vehicle position is defined by btDefaultMotionState during chassis rigid body creation (a vehicle is dropped from an initial height - btVector3(0, 5, 0)). I would like to use btCompoundShape to lower center of the gravity/mass of the vehicle. Is it possible ? I create a compound shape and add a chassis shape as a child shape: 


compound->addChildShape(localTransform, chassisShape);

Then a compound shape is used during a rigid body creation instead of a chassis shape and btDefaultMotionState is set as previous. I wonder how I should set a local transform for the compound shape ?

When I use btVector(0, -1, 0) for localTransform I get the following result when a vehicle is dropped from an initial height. It looks like I'm doing something wrong.

This topic is closed to new replies.

Advertisement