[ODE] body geometry dualism
Martin C. Martin
martin at metahuman.org
Wed Aug 14 05:25:02 2002
> Michael Scharvogel wrote:
>
> Why is it necessary to keep this body - geometry dualism.
>
> If i got it right, I habe to set the geometry position AND the body
> position. So what's the difference in these positions and why do I have
> to keep them consistent / what happens if I don't keep them that way ??
By keeping them the same, you're assuming that the center of mass is at
the geometrical center of the shape. If the density of the object is
uniform than this is true, but if it's not, then it doesn't have to be
true.
Russ mentioned that they're two separate concepts, and there's a
consequence of that. ODE's dynamics already works for rigid body's of any
shape whatsoever, whereas collision only works for the geometric shapes
listed in the manual.
That's because to calculate dynamics, all we need to know about a body is
its total mass and it's "inertia matrix." The inertia matrix has, more or
less, three degrees of freedom. So, all we need are 4 mass numbers, and
as far as dynamics is concerned, we know everything we need to know about
the shape. Once we have that, the only dynamic state is the location of
the center of mass, three angles, and the rate of change of those (i.e.
the linear and angular velocities).
For non uniform mass distribution, the center of a shape can be completely
different than the center of mass. In fact, ODE as it is can handle
collision and dynamics for a box with ANY distribution of mass, no matter
how crazy it gets, even if the center of mass is outside of the box (which
is impossible in "normal" physics.)
- Martin