[ODE] no box/trimesh collision, Unix only

Jeffrey Smith jeffreys at Softimage.com
Wed Dec 17 12:14:45 MST 2003


> I have a problem where no contact points are generated between boxes
> and trimeshes.  This is in Unix only.  It works fine in Windows!

I'm also having problems with trimesh/bounding box collisions.
Specifically, they don't work at all if the trimesh object is smaller
than the bounding box object.  

After some code-diving and debugging, I think I've discovered the
problem.  To wit, the candidate contact points generated (line
563 of collision_trimesh_box.cpp):

			dVector3 ContactPos;
			ContactPos[0] = BoxVertices[j][0];
			ContactPos[1] = BoxVertices[j][1];
			ContactPos[2] = BoxVertices[j][2];
			ContactPos[3] = REAL(0.0);

will always be vertices of the bounding box primitive, even if these
vertices are well outside of the boundaries of the triangle currently
being examined.  This point is eventually used by LinePlaneIntersect
(line 583) to create OutPos (which will become the contact point, if
some other tests are passed).  However, LinePlaneIntersect does
intersections with infinite lines, not line segments, which means that
if ContactPos is outside the currently examined triangle, it will
remain outside.  Thus, one or more of the PointPlaneIntersect tests on
line 587 will always fail.

I have to admit, however, that I find collision_trimesh_box.cpp mostly
incomprehensible. The lack of comments or documentation on what's
going on inside make it difficult for me to debug it.  Is Erwin de
Vries still on this list?  If so, can you confirm my analysis?  And,
if I'm right, what can I do fix this bug?

-Jeff




More information about the ODE mailing list