[ODE] Inconsistent depth return for dGeomRay

Adam D. Moss adam at gimp.org
Tue Jan 13 14:37:44 MST 2004


Shamyl Zakariya wrote:
> I've been trying to implement a kind of range finder class using 
> dGeomRay -- as part of a feedback system for my robotics simulations.
> 
> I'm having trouble with the depth returned by dCollide, however -- it's 
> inconsistent, or rather, it seems to sometimes skip geoms in my 
> simulation completely; other times it sees the same geom just fine. It's 
> repeatable, but doesn't follow any pattern I can detect.

ODE's Ray geoms will (should) cause a collision callback for
each (implemented) geom they probably-touch -- not exclusively the
first/nearest.  These callbacks will occur in fairly arbitrary order,
so it's up to the app to track which one is the nearest to the
ray's origin for processing after collision is completed, if that data
is important.  (This could be done elegantly by storing a 'nearest
ray collision found so far' struct as userdata on the ray geom.)

Regards,
--Adam
-- 
Adam D. Moss   . ,,^^   adam at gimp.org   http://www.foxbox.org/   co:3
"At this point the rocket becomes engorged with astronauts."


More information about the ODE mailing list