Moment of inertia for complex object

David20321
Posts: 17
Joined: Sat Mar 13, 2010 10:08 pm

Moment of inertia for complex object

Post by David20321 »

There are a number of cases where the automatic moment of inertia is not sufficient for a complex object with a convex hull, since it assumes uniform mass distribution within the hull's bounding box. An extreme example would be a lollipop -- the mass distribution is almost all in the sphere at the end, with only a small distortion from the little cylinder handle. Even if I shift the model so the center of mass is in the right place, the rotations are still strange because of the moment of inertia approximation.

Do you have any ideas about the best way to handle these kinds of cases? I was thinking of voxellizing the model and then integrating the distance of each point from the cardinal axes, but I'm not sure how to give that information to Bullet in a useful way. Has anyone worked on this before, or have any ideas about getting accurate moments of inertia?
winspear
Posts: 77
Joined: Thu Nov 26, 2009 6:32 pm

Re: Moment of inertia for complex object

Post by winspear »

My best guess is to make a compound shape. Break down the model in to a bunch of simple shapes and assign the moment of inertia accordingly.
In the case of the lollipop, it would be a "sphere" and a "thin cylinder or box" .