[ODE] dRaySet optimization

Joe Ante joe at uti.is
Fri May 21 01:46:34 MST 2004


Hi,

Can someone check this into cvs.

dGeomRaySet has been a profiled performance bottleneck in a scene where I
did a large amount of raycasts.

Replace dGeomRaySet  with the following function:

void dGeomRaySet (dGeomID g, dReal px, dReal py, dReal pz,
          dReal dx, dReal dy, dReal dz)
{
  dUASSERT (g && g->type == dRayClass,"argument not a ray");
  dReal* rot = g->R;
  dReal* pos = g->pos;
  pos[0] = px;
  pos[1] = py;
  pos[2] = pz;
  
  rot[0*4+2] = dx;
  rot[1*4+2] = dy;
  rot[2*4+2] = dz;
  dGeomMoved (g);
}

It is tested and seems to work with all colliders.

Joe Ante



More information about the ODE mailing list