[ODE] Determining if a point is inside a geom

David Walters hidden.asbestos at googlemail.com
Tue May 8 13:25:58 MST 2007


> I'm trying to come up with a quick way to test if a point is inside a
> geom, primarily so I can check if a lightsource goes inside a shadow-
> caster but I imagine it will be useful elsewhere. I've taken two
> approaches, but both only work for trimeshes ( significant! ) and not
> for primitive types such boxes, capsules, etc.

Hi, if you take a look at the latest heightfield code - in
dCollideHeightfieldZone there's a switch at line 958 - here a
dGetDepthFn pointer is set based on geom type.

Further down at line 1460 this pointer, if set, is used to determine
if a proposed contact penetrates the geom. If the pointer is NULL
(i.e. trimeshes) then an alterantive ray cast solution is used.

Now I'm not saying this is going to help you too much, but I feel like
I've given you some information here by pointing out the
dGeomXXXPointDepth functions which return > 0 for a point if it's
inside a geom.

Regards,
David Walters


More information about the ODE mailing list