[ODE] Adjusting a body's mass

Jon Watte hplus-ode at mindcontrol.org
Mon Mar 21 09:47:29 MST 2005


> > 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

> Suppose we have dBodyID b1 and another body b2 connected via joint to b1,
> b1 has mass m1 and b2 - m2. Now, how exactly can i lower center of
> gravity, of body b1, by n units (i need exact function calls :P, please...)

To offset the geoms of a body, use dGeomTransform objects to put the 
geoms where they should be, after you offset the center of the body.
To offset the joint attachment points, just use the points in world 
space where you want them to be.

If you need me to write code for you, I bill hourly, and there's 
a minimum retainer up front. Please contact me off-list if you are 
interested in this option.

Cheers,

			/ h+




More information about the ODE mailing list