[ODE] Adjusting a body's mass

Jon Watte hplus-ode at mindcontrol.org
Mon Mar 14 17:13:38 MST 2005


> Let's see, does that mean I have to use the dMassSetParameters() method?
> Aside from dMassTranslate(), this is the only method with access to the
> center of gravity position.

Even if you offset the center of gravity, the Body will not pay attention 
and it won't work right. You really do have to offset the center of the 
body, and counter-offset all joints and geoms.

So, the algorithm would be:

1) add in all masses into a single dMass
2) get the center of gravity from the mass
3) offset the body by that much (counter-offsetting everything attached to that body)
4) counter-offset the dMass to origin, and set that as the mass of the body

Cheers,

			/ h+




More information about the ODE mailing list