[ODE] Mass translation problems

Jon Watte hplus-ode at mindcontrol.org
Fri Dec 3 09:15:24 MST 2004


> > The translation of a mass is not respected by a body. The center of mass is
> > always at the center of the body. You have to instead translate your geom,
> > typically using a GeomTransform. This is mentioned in the FAQ, by the way.

> Is that really true?  In my simulation I use dMassTranslate(0, -5000, 0) to
> translate the mass of my characters downwards.  I found that this caused the
> objects to not topple over.  Removing this line allows the objects to topple. 
> This is how I keep all my characters upright in the game.. and it seems to
> work.. so what am I missing?

If you look at how the body actually uses the mass, it assumes that the 
mass is centered in several locations. For example, where it uses "b->invI" 
it does not look at the translation part at all. However, it may be used in 
some places, so any center not equal to origin is very likely to have 
problems.

Similarly, where the stepper uses the "mass" directly, it typically only 
plucks out "I", not the translation "c"; nor, where torque is resolved into 
rotation, does it offset the rotation part by the center of gravity. At least 
in my copy of the source -- just grep for "mass.c" or just "->c[^a-z]" and 
see the emptiness.

I agree that I also believe I've seen miscellaneous simulation changes when 
you translate the mass before setting it. However, those changes have not been 
what you would actually expect if the translation was properly accounted for; 
rather, they seemed to be odd side effects of a not fully consistent 
implementation, and small enough that they might have been figments of 
imagination.

Cheers,

			/ h+




More information about the ODE mailing list