[ODE] Optimizing ode for simple collision detection
pieter Mollemans
pmolle at gmail.com
Tue Oct 23 00:48:54 MST 2007
Hello,
I'm trying to implement a verry fast collision detection between 2
objects . The 2 objects can be moved around freely in a 3d environment.
I managed to do this with ode but when i execute my example there is
some delay on the movement of the objects (especially if there is a
collision). So I wondered if there are some ways to fasten the
algorithm. I'm not intressted in where the collision took place or how
many points collided, i just want to no if there is a collision or not.
i use the dcollide() function to detect a collision. The two objects are
triangular meshes.
code i use for detecting the collision
--------------------------------------------------------
dGeomTriMeshDataBuildSimple(this->odetrimeshdata, (dReal*)
this->odevertices, coordcount, this->odeindices, (nbnewtri*3));
this->odegeomdata = dCreateTriMesh(0, this->odetrimeshdata, 0, 0, 0);
dGeomSetPosition (geom1, (float) matrix[3][0], (float) matrix[3][1],
(float) matrix[3][2]);
dGeomSetPosition (geom2, (float) matrix2[3][0], (float)
matrix2[3][1], (float) matrix2[3][2]);
dGeomSetRotation(geom1, bodyrot1);
dGeomSetRotation(geom2, bodyrot2);
dContactGeom contact[1];
int numc = dCollide (geom1,geom2,1,&contact[0],sizeof(dContactGeom));
More information about the ODE
mailing list