[ODE] enhanced ODE collision API

Nate W coding at natew.com
Thu Oct 24 16:03:01 2002


On Fri, 25 Oct 2002, David McClurg wrote:

> one other common concept in collision detection is a ghost or phantom
> geom used as a sensor.  you don't bounce off it -- you just detect a
> penetration.  ie: what you want is just detection of the collision and
> not the contact information.  it would be nice if there was a built-in
> type called 'sensor' or something that didn't do the extra work of
> computing the contact point/normal.

Could you do that by filtering out collisions involving the 'sensor' geoms
in the collision callback?  Like:

	int count = dCollide (o1, o2, contacts, &contact[0].geom ...

	MyClass *p1 = dGeomGetData (o1);
	MyClass *p2 = dGeomGetData (o2);

	if (p1->isSensor)
		p1->CollisionDetected (count, contact)
	if (p2->isSensor)
		p2->CollisionDetected (count, contact)

	if (!p1->isSensor && !p2->isSensor)
	{
		// create contact joints
	}

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com