[ODE] Question about center of gravity/mass

Remi Ricard remi.ricard at simlog.com
Thu May 4 06:02:43 MST 2006

It is stated at several places in the documentation that the center
of gravity must be at the origin of the body frame.

The Howto about the Composite object present how to do it properly.

So my question is: Why should we live with this constraint.
I want to set my body frame where I want and not be a "slave" of the center
of mass.

I looked at the code and this could be added in the dInternalStepIsland...

//     { // RR 2006.05.03
//       // Needed if we want the center of gravity not at body frame
//       dVector3 F, p;
//       dMULTIPLY0_331 (p, b->posr.R, body[i]->mass.c);
//       F[0] = world->gravity[0] * body[i]->mass.mass;
//       F[1] = world->gravity[1] * body[i]->mass.mass;
//       F[2] = world->gravity[2] * body[i]->mass.mass;
//       F[3] = [0];
//       dCROSS (body[i]->tacc, +=,p, F);
//     }

It can be placed near the calculation of the "gravity force"

after that the functions
dBodyAddForce... will also need some modification

I'm ready to create a patch for that but I want to hear the pros and cons of
the current approach and why we should stay with what we have (i.e. 
center of mass
body frame).


More information about the ODE mailing list