Code: Select all
void processCollisions(){
for(unsigned int i=0; i < world->getNumManifolds(); i++){
ICollisionCallbackInformation *info = world->getCollisionCallback(i);
unsigned int numContacts = info->getPointer()->getNumContacts();
for(unsigned int j=0; j < numContacts; j++)
if(info->getContactPoint(j).getDistance()<1.5f && info->getContactPoint(j).getLifeTime() < 2.0f){
io::IAttributes* body0 = info->getBody0()->getAttributes();
io::IAttributes* body1 = info->getBody1()->getAttributes();
core::stringc type0 = body0->existsAttribute("Type")? body0->getAttributeAsString("Type") :L"None",
type1 = body1->existsAttribute("Type")? body1->getAttributeAsString("Type") :L"None";
/* Look at the types and call functions that fit */ }
info->getPointer()->clearManifold();}}
The moment there is a collision, a runtime crash occurs.
With debugging I have found that this happens the moment body0->existsAttribute("Type") is called, but some more debugging showed that any function call on body0 and body1 result in a crash.
Although this is typical for a null-pointer, the pointers aren't 0x000000 and will be true when used as a bool.
I've already tried recompiling irrlicht and irrBullet without success.