-
In the game I'm working on (a space sim) the artists define an object's center of mass and export the assets so that it's in the coordinate origin. We're using compound shapes for most objects and I'm finding that Jolt always adds an automatically calculated offset to it. This causes some issues, especially with rotational movement. Is there some way I could disable this or is that only achievable with a DecoratedShape that forces the center of mass offset to zero? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Jolt indeed automatically calculates the center of mass for any created shape. If you want to force the center of mass to the origin you can use the OffsetCenterOfMassShape to do so, you'd create one with:
|
Beta Was this translation helpful? Give feedback.
-
If you're working with a MutableCompound shape you could also just create an empty one and then Add/Remove Shapes afterwards without calling AdjustCenterOfMass. That will also keep the COM at the origin. |
Beta Was this translation helpful? Give feedback.
Jolt indeed automatically calculates the center of mass for any created shape. If you want to force the center of mass to the origin you can use the OffsetCenterOfMassShape to do so, you'd create one with:
my_new_shape = new OffsetCenterOfMassShape(-my_original_shape->GetCenterOfMass(), my_original_shape)