Code: Select all
int numManifolds = phys->getDispatcher()->getNumManifolds();
for(int i = 0; i < numManifolds; i++) {
btPersistentManifold* manifold = phys->getDispatcher()->getManifoldByIndexInternal(i);
printf("%i\n", manifold->getContactPoint(0).getLifeTime()); // this line is from memory.
if(manifold->getContactPoint(0).getLifeTime() == 0) {
ent* one = (ent*) manifold->getBody0()->getUserPointer();
ent* two = (ent*) manifold->getBody1()->getUserPointer();
one->onCollide(two);
two->onCollide(one);
printf("collid\n");
}
}