[ODE] Finding depth of a contact joint

john rieffel jrieffel at gmail.com
Mon Aug 22 14:39:08 MST 2005

Now that I've figured out how to create and copy large composite
objects, I'd like to be able to check whether I can place them in the
space without their being insert into other items -- that is, to make
sure that there's "room" for them where I want to put them.

The best way I've figured out how to do this is to place the composite
object in the space and then call dSpaceCollide - and determine if a)
any contact joints exist for that inserted body and b) if they exist,
whether the inserted body is "penetrating" the pre-existing object.


dSpaceCollide (space,0,&staticNearCallback);
int numjoints = dBodyGetNumJoints(newobj.body);
      for (int i = 0; i < numjoints; i++)
	  dJointID curjoint = dBodyGetJoint(newobj.body,i);
	  if (dJointGetType(curjoint) == dJointTypeContact)

obviously this will tell me how many joints are connected to the body
in question - and let me iterate through them, but how do I get the
depth of the contact joint?   I know that this info is stored within
the contact's contact geom (dContactGeom.depth) - but I can't for the
life of me figure out how to *get* to this data  - I can't find a
dJointGetContactGeom method.  Am i missing something?

More information about the ODE mailing list