[ODE] nearCallback() question

David McClurg dmcclurg at pandemicstudios.com.au
Wed Aug 21 16:26:02 2002


For Erwin and anyone interested...

BUG: the order of the geoms passed to the near callback are not consistent with the order of the geoms in the contact generated in sphere vs trilist collisions...

---
geom.cpp: dCollide()
    swap = colliders2[a1].mode;
    if (swap) count = (*fn) (o2,o1,flags,contact,skip);
    else count = (*fn) (o1,o2,flags,contact,skip);

dTriList.cpp: dCollideSTL()
int dCollideSTL(dxGeom* TriList, dxGeom* Sphere, int Flags, dContactGeom* Contact, int Stride){
	return GetData(TriList)->CollideSphere(Sphere, Flags, Contact, Stride);
}

dTriListCollider.cpp: dcTriListCollider::CollideSphere()
				OutContact.b1 = dGeomGetBody(Sphere);
				OutContact.b2 = dGeomGetBody(Geometry);
---

Notice that the geoms/bodies are reversed in CollideSphere() from the geoms passed to the dCollideSTL() collider.

CollideSphere() needs to be fixed.  For each contact created...
	// swap g1 & g2 in the contact
	// negate the normal

Erwin-- is this sufficient or do you want a patch?

ALSO-- the CollideRay() I posted earlier has the same problem.