[ODE] Doc detail

Olivier Michel Olivier.Michel at cyberbotics.com
Fri Jan 10 00:59:02 2003


Hello,

Just to say that the example provided in the doc (under section 9.5 
Collision detection) doesn't compile under gcc. It just need a  cast 
when calling dSpaceCollide:

void nearCallback (void *data, dGeomID o1, dGeomID o2)
  {
    if (dGeomIsSpace (o1) || dGeomIsSpace (o2)) {
      // colliding a space with something
      dSpaceCollide2 (o1,o2,data,&nearCallback);
      // collide all geoms internal to the space(s)
      if (dGeomIsSpace (o1)) dSpaceCollide ((dSpaceID)o1,data,&nearCallback);
                                            ^^^^^^^^^^
      if (dGeomIsSpace (o2)) dSpaceCollide ((dSpaceID)o2,data,&nearCallback);
                                            ^^^^^^^^^^
    }
    else {
      // colliding two non-space geoms, so generate contact
      // points between o1 and o2
      int num_contact = dCollide (o1,o2,max_contacts,contact_array,skip);
      // add these contact points to the simulation
      ...
    }
  }

-Olivier