[ODE] Moment of Inertia

Martin C. Martin martin at metahuman.org
Thu Aug 14 10:26:01 2003


> James Gjerde wrote:

> my question is regarding the inertia tensor for a rigid body, and its
> representation as a 3 by 3 matrix. lets say my body is a uniform cube
> and i initially calculate the moment of inertia in local space where the
> cube is not rotated at all. and assuming the shape and mass never change
> throughout the simulation, the moment of inertia will not change as well
> ??

ODE stores the moment of inertia relative to the body, not the world.  So,
it won't change.

> my other question would also be since a cube is completely symmetrical
> about each axis, wouldn't it also be true that all the other elements of
> the inertia tensor with exception to the diagonal components would
> always be zero as well?

Yes.  Look at the implementation of dMassSetBox (or whatever its called). 
It's only a few lines.

> i am assuming
> though it is common practice to transform the tensor into world space
> coords since that is how in a simulation forces are represented.

It's easy enough to transform the inertia tensor to world coordinates, you
just multiply by the rotation matrix.  So, how you use it doesn't need to
be related to how you store it.

- Martin

#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################