[ODE] collider function array

Marco Grubert mgrubert at conitec.net
Thu May 29 15:56:02 2003


Not sure if this has recently been changed, but dCollideUserGeomWithGeom()
(collision_kernel) has the following lines in it:
// ....
// set the colliders array so that the correct function is called directly
// the next time around. note that fn can be 0 here if no collider was
found,
// which means that dCollide() will always return 0 for this case.
colliders[t1][t2].fn = fn;
colliders[t1][t2].reverse = reverse;
colliders[t2][t1].fn = fn;
colliders[t2][t1].reverse = !reverse;
// ....

If object1 and object2 are of identical type then contacts will
unneccesarily be reversed in all future collision calls.
Recommendation:
colliders[t1][t2].fn = fn;
colliders[t1][t2].reverse = reverse;
if (t1!=t2) {
  colliders[t2][t1].fn = fn;
  colliders[t2][t1].reverse = !reverse;
}

- Marco Grubert