[ODE] (no subject)

Mike Sly odelist at hotmail.com
Mon Jun 14 18:54:12 MST 2004


Hello! I?m starting to use ODE in a few weeks and I can?t get my collisions 
working perfectly.



I have a geomBox representing a table and another geom.Bocx representing a 
teapot (the teapot as a body too, but the table don?t). I put the teapot 
above the table and when I run the simulation the teapot falls down because 
of gravity, and hits the table.

Till here everything is just fine. But in a second the teapot just 
disappears from the top of the table.

Why is that?



I have put this parameters in my collision callback:



void PhysicsManager::nearCallback(void *data, dGeomID o1, dGeomID o2){

      const int N = 100;

      dContact contact[N];

      int n;



      n = dCollide(o1, o2, N, &contact[0].geom, sizeof(dContact));



      //if there are potencially collisions

      if(n > 0){

            dWorldID worldID = odeMgr->getWorld();

            dJointGroupID jointLegal = odeMgr->getJointGroup();

            //process any contact

            for(int i = 0; i < n; i++){

                  //setup the contact parameters

                  contact[i].surface.mode = dContactSlip1 | dContactSlip2 | 
dContactSoftERP | dContactSoftCFM | dContactApprox1;

                  contact[i].surface.mu = 0.5;

                  contact[i].surface.slip1 = 0.0;

                  contact[i].surface.slip2 = 0.0;

                  contact[i].surface.soft_erp = 0.8;

                  contact[i].surface.soft_cfm = 0.01;



                  //create and attach the contact points

                  dJointID c = 
dJointCreateContact(worldID,jointLegal,contact+i);

                  dJointAttach(c,dGeomGetBody(o1),dGeomGetBody(o2));

            }//for

      }//if

}



any ideas?

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus



More information about the ODE mailing list