Inertia tensors and axes

Post Reply
Gregwar
Posts: 11
Joined: Mon Nov 16, 2015 6:27 pm

Inertia tensors and axes

Post by Gregwar »

Hello,

I am currently working on simulations using voxels to generate inertia tensors, com & mass
What i'm currently doing is giving the center of mass of my part to bullet using default motion state and giving it ixx, iyy and izz using the sum of all voxels (i.e ixx is the sum of (y*y+z*z)*m)

What I think I'm missing is that there is non-diagonal elements that should be used. If I understand well, I should align the center of mass transformation in such a way that non-diagonal elements are zero.

Us this why the centerOfMassOffset is a btTransform, To get inertia axes aligned?
How do I compute this transformation?

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

Re: Inertia tensors and axes

Post by Erwin Coumans »

You can re-align the geometry (collision object) using a btCompoundShape to reflect this center-of-mass offset transform, while the rigid body is still aligned along the principal axis of inertia.

There is some computation that may help in btCompoundShape::calculatePrincipalAxisTransform

It would be useful to have some example how to do this. You will have to manually convert back this offset when rendering the geometry. Using the btDefaultMotionState to keep track of this offset may help.

Good luck!
Erwin
Post Reply