[ODE] Assembling Bodies

Jaap Stolk jwstolk at gmail.com
Tue Apr 18 08:04:10 MST 2006


On 4/18/06, J. Perkins <starkos at gmail.com> wrote:
> That's correct. You should not create collision joints on those two
> bodies if they already have a fixed joint between them. ODE has an
> "IsConnected" method (check the docs, don't remember the exact call)
> to tell if there is a joint in place between two bodies.

I used this in my latest simulation. so the directly connected bodies
can hinge into eachother without generating collitions.
see the knee joint in: http://jwstolk.xs4all.nl/wisse/test4b.mpg  [632 kb]
( more animations and the source code at: )
http://jwstolk.xs4all.nl/wisse/?M=A

I also added an extra check, because dAreConnectedExcluding() failed
if one of the objects was the ground. like this:

static void nearCallback (void *data, dGeomID o1, dGeomID o2){
  dBodyID b1 = dGeomGetBody(o1);
  dBodyID b2 = dGeomGetBody(o2);
  // skip collisions between bodies connected by a hinge:
  if( o1!=ground && o2!=ground && dAreConnectedExcluding(b1, b2,
dJointTypeContact) ) return;
  --- code for handling colitions here ---
}



More information about the ODE mailing list