[ODE] Space additions for dRay

Erwin de Vries erwin at vo.com
Tue Aug 6 13:01:01 2002


> > // Collides a single geometry with the other geometries in the space
> > void dSpaceCollideGeom (dSpaceID space, dxGeom* g, void *data,
dNearCallback *callback);
>
> This sounds pretty useful for casting some rays down on a terrain mesh and
showing a quick topo map or building a shadow off-line.  I suppose I could
go directly to Opcode for that, but where is the Opcode documentation?

For this you can also simply call dCollide() directly for your set of rays.
:-)

> Also, I have a question about tri-lists in ODE.  If I want to create
several of them so collisions can be seperately detected, how do I avoid ODE
trying to collide them against each other?  If I put them in a geomGroup
then I don't get to know which mesh actually collided.  Also, if neither has
a body, why are they even tested against each other?

Just think of a bodyless (why would it need a body?) ray, against a bodyless
triangle mesh. Your case here was one of my own collision rules which i
needed to special case for things like these rays. Usually there is little
reason to collide two bodyless geometries. You could modify ODE to use a
second callback to let you decide if you even want to test the AABB's of
both geometries, but any gains are unlikely. The AABB-AABB test is really
fast. Doing an extra function-trough-pointer call which might or might not
cull the collision based on information that is probably requested using
even more function calls (dGeomGetBody(), dGeomGetData()) renders this
callback competely useless. If anything would be added it would need to be
something like void dGeomForceCollision(int x) (ODE would have this enabled
by default) which tells the space if a geometry doesnt need
bodyless-bodyless pairs. You generally only want to enable this for things
like rays. This would result in a minor speed gain. It saves some function
calls.

Erwin