[ODE] Box-box and cilynder-trimesh collisions
jpgr at mega.ist.utl.pt
jpgr at mega.ist.utl.pt
Thu Mar 17 14:44:19 MST 2005
Hi
I am using ODE 0.5 with dev-c++, and I am having some problems with collision
detection.
I am making a car driving game: the car is made by a chassis (geomBox), four
wheels (geomSpheres), a road (trimesh) and some obstacles (geomBoxes).
I got two problemas here:
1)
The car chassis does not colide with the obstacles and with the road. The
dCollide function return >0 (it finds contact points) but there is no reaction
to the collision. The car wheels collide correctly with both road and
obstacles.
2)
Replacing the car wheels geometry (geomSpheres) by geomCylinders, the wheels do
not collide with the road anymore.
Here is my ProcessCollisions code:
// Process collisions
dJointGroupID jointGroup = dJointGroupCreate(0);
if (numContacts>0)
{
for (int i=0; i<numContacts; i++)
{
contacts[i].surface.mode = 0;
contacts[i].surface.mu = 10000;
dJointID jointContactID = dJointCreateContact(world->getWorldID(),
jointGroup, &contacts[i]);
dJointAttach(jointContactID, dGeomGetBody(contacts[i].geom.g1),
dGeomGetBody(contacts[i].geom.g2));
dJointDestroy(jointContactID);
}
}
// Step
world->step(timer->getDT());
dJointGroupDestroy(jointGroup);
It seems that only collisions between spheres and any other geom are working. Do
you have any suggestions how to solve this problem?
Thanks in advance,
Joao Rangel
More information about the ODE
mailing list