[ODE] Joints between static environment and itself?

ChrisC zppz at yahoo.com
Wed Nov 29 08:54:03 MST 2006


I have a trimesh terrain, and some large objects (eg.
a house) the bodies of which are both in the static
environment (body id = 0). I noticed that when I
embedded a large object in the terrain, the world step
calculation time became huge - the more terrain the
house intersected with, the slower it got. I traced
the problem to the code I was using to make contact
joints between colliding bodies, I think this code is
pretty typical if you look at the test programs:
(in nearCallback, b1 and b2 are body ids)

if (b1 && b2 && dAreConnectedExcluding
(b1,b2,dJointTypeContact)) return;

This will make a contact joint between two bodies even
if they are of the same body id. Looking further into
dJointAttach I found that as you would expect, this is
not actually the case, and there is an assert to make
sure you don't add a joint between a body and itself:

dUASSERT (body1 == 0 || body1 != body2,"can't have
body1==body2");

However, an exception is made for bodies of the static
environment... 
My question is, does it ever make sense to add a joint
between a body and itself, even bodies of the static
environment? Am I overlooking some case where you
might want to do this for the static environment?







 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com


More information about the ODE mailing list