[ODE] performance with rays

David McClurg dmcclurg at pandemicstudios.com.au
Tue Feb 4 19:05:02 2003


oops. growing the AABB wouldn't work. i think to avoid extra checks, the ray needs to be broken up into pieces.  perhaps the step could be specified when you create the ray.  the step would be 0-1 as a fraction of the total length of the ray.

in addition, a ray 'radius' would be useful and easy to implement because at the point of potential contact, you just check a sphere radius instead of an epsilon.

  dGeomID dCreateRay (dSpaceID space, dReal length, dReal radius = 0.f, dReal step = 1.f)

comments?

-----Original Message-----
From: David McClurg 
Sent: Wednesday, 5 February 2003 11:48 AM
To: ode@q12.org
Subject: [ODE] performance with rays


I'm not using the latest ODE but I've noticed something about rays...

I use rays for ground height detection and line of sight (LOS).  For ground height, the ray points straight down and no worries.  For line of sight, my ray is very long (150m), crosses alot of terrain, and it ends up checking thousands of triangles in my static geometry, thus killing my frame rate.

Proposal:  What I propose is that rays only return one contact point -- the nearest one.  The test should be iterative with an early out.  Perhaps grow the AABB each step or some other incremental approach.

If this is already handled or there is another solution, let me know.  Otherwise, I'll have to patch this before I can use rays in ode for LOS.

Ta