[ODE] collion body vs geom
slipch
slipch at gsc-game.kiev.ua
Tue Jan 13 10:29:09 MST 2004
Err. I mean :
static dContact contacts[N];
// get the contacts up to a maximum of N contacts
ULONG n;
.............
n = dCollide(o1, o2, N, &contacts[0].geom, sizeof(dContact));
...............................
for(i = 0; i < n; ++i)
{
..........................
dBodyID b1 = dGeomGetBody(contacts[i].geom.g1);
dBodyID b2 = dGeomGetBody(contacts[i].geom.g2);
if(b1==body[1] && contacts[i].geom.g2==wall ) continue ;
if(contacts[i].geom.g1==wall && b2==body[1] ) continue ;
dJointID contact_joint = dJointCreateContact(phWorld, ContactGroup, &contacts[i]);
dJointAttach(contact_joint, b1, b2);
}
More information about the ODE
mailing list