for example
- Code: Select all
if (testcollision(body1,body2)==true){
//do anything
}
Moderators: Sascha Willems, walaber
if (testcollision(body1,body2)==true){
//do anything
}
bool checkContacts( NewtonWorld* world, NewtonBody* obj1, NewtonBody* obj2 ) {
const int maxsize = 4;
float contacts[3*maxsize];
float normals[3*maxsize];
float penetra[3*maxsize];
dMatrix t1, t2;
NewtonBodyGetMatrix( obj1, &t1[0][0] );
NewtonBodyGetMatrix( obj2, &t2[0][0] );
NewtonWorld* nworld = world->getNewtonWorld();
if ( NewtonCollisionCollide( nworld, maxsize, NewtonBodyGetCollision(obj1), &t1[0][0], NewtonBodyGetCollistion(obj2), &t2[0][0], contacts, normals, penetra ) != 0 ) {
return true;
} else {
return false;
}
}
Users browsing this forum: No registered users and 18 guests