Discussion:
Preventing contacts between connected bodies
Brett Hemes
2007-11-14 18:16:48 UTC
Permalink
Looking through the sample code I have noticed the following code in
the nearCallbacks:

dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnected(b1, b2))
return;

and

dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact))
return;

The benefit of the second is not completely clear to me.

Also would it help to have a line:

if(b1 == b2) return;

for composite objects?

Thanks,
Brett
Mark Williams
2007-11-14 19:02:33 UTC
Permalink
Post by Brett Hemes
Looking through the sample code I have noticed the following code in
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnected(b1, b2))
return;
and
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact))
return;
The benefit of the second is not completely clear to me.
I guess the second would allow multiple contacts to be generated between
colliding bodies, whereas the first would not.

Cheers,
Mark
Remi Ricard
2007-11-14 19:33:12 UTC
Permalink
Hi Brett,
Post by Brett Hemes
Looking through the sample code I have noticed the following code in
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnected(b1, b2))
return;
and
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact))
return;
The benefit of the second is not completely clear to me.
This is useful if you want more than one contact point between two
bodies usually this may help stability.
If the joint are connected with something other than a contact joint you
return.
Post by Brett Hemes
if(b1 == b2) return;
for composite objects?
This is already done at a higher level.

Remi
Jon Watte (ODE)
2007-11-14 22:21:42 UTC
Permalink
I find that the documentation for dAreConnectedExcluding() in the manual
is fairly clear, and explains the answer to your question succinctly.

Cheers,

/ h+
Post by Brett Hemes
Looking through the sample code I have noticed the following code in
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnected(b1, b2))
return;
and
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact))
return;
The benefit of the second is not completely clear to me.
if(b1 == b2) return;
for composite objects?
Thanks,
Brett
------------------------------------------------------------------------
_______________________________________________
ODE mailing list
http://ode.org/mailman/listinfo/ode
Continue reading on narkive:
Loading...