[ODE] Joints and bodies

Nate W coding at natew.com
Sat Jan 11 00:51:01 2003


On Sat, 11 Jan 2003, Vadim Macagon wrote:

> I'm trying to figure out how the joints connect the bodies... you can set
> the anchor for the joints, but I can't figure out how it determines the end
> points where the joint is connected to the bodies, unless it just uses the
> centers of mass for this. The pretty pictures in the ODE docs show the joint
> being connected to one side of the boxes, but what about spheres, capsules
> and arbitrary geometry?

The thing is, there are no "points" of connection.  When you joint two
bodies with a hinge, for example you just define an axis about which they
may rotate relative to each other, and it's the direction and position of
that axis that matter.  

Imagine joining two real-world blocks of wood with a real-world hinge,
like a door hinge... For any location of the hinge, there are an infinite
number of places you could ALSO put the hinge, which would create exactly
the same effect.  All that's necessary is that all of the hinge axes lie
along a common line in space.  

If you want to simulate that in ODE, you just need to know where that line
is - a point on the line (what ODE calls the "anchor"), and a vector
parallel to the line (what ODE class the "axis").

Wide slider joints, it's even more abstract, because the only thing that
really matters is the angle of the slider - there's no concept of the
joint's location at all.

In the ODE application I wrote (Juice), I wanted to depict the joints as
if they had a particular position, beyond just the minimum abstraction
that ODE works with.  For ball joints, it was trivial, for hinges it was
fairly simple, for sliders I had to do a fair amount of work to keep track
of where the joint was "located."  

The main thing to realize is that "attachment points" are just an
inconvenient real-world necessity.  In a mathematical sense, the few
parameters required by the ODE API are really all that matters.

I hope this helps,


Nate Waddoups
Redmond WA USA
http://www.natew.com