[ODE] Putting in your own collision detection

Anders Olofsson anders.olofsson at biologigrand.ac
Wed Dec 18 06:42:01 2002


Hello again. I'm trying to put in my own collision detection between static 
geometry and the bodys..
I got it working fairly good, but not quite there yet..

I was wondering, when I've detected a collision what is the "minimum" 
information I need to put in to
the dContact structure?.. So far I've done this:

contact->surface.mode = 0;
contact->surface.mu = 0.5;
contact->surface.mu2 = 0;
contact->geom.depth=mdist;                 //Penetration distance
contact->geom.normal=collisionNormal; //Normal of triangle wich body 
collided into
contact->geom.pos=position;                //Vertice from body wich collided

And then called these:

c = dJointCreateContact (world,contactgroup,&contact);
dJointAttach (c,body,0);


Basicly from the test examples. What happen is as usual, the objects 
doesn't come to rest.
And it gets worser with greater gravity force..

If there is nothing more essential to put into the contact structure I 
guess its something
wrong with my collision detection...

The reason for doing my own collisions is that I got bodys built up from 
arbitrary shaped cuboids or
convex shapes with 8 vertices.. Could be for example a flat top pyramid and 
stuff like that.
If I'm not mistaken ODEs boxes is always "square like", since you only 
supply the dimensions of the
box when created?..