HPL1: Add workaround for invalid collider

This commit is contained in:
grisenti 2023-10-11 16:14:16 +02:00
parent de81248bb4
commit d35800fce7

View File

@ -1406,6 +1406,13 @@ cMeshEntity *cMeshLoaderCollada::CreateStaticMeshEntity(cColladaNode *apNode, cW
pVtxBuffer->GetArray(eVertexFlag_Position)[22] = -64.470757f;
}
// WORKAROUND: Bug #14572: "HPL1: crash after breaking the ice in level "Lake Utuqaq""
// The object below has an empty mesh that generates an invalid collider, which causes a crash when the Newton library
// tries to resolve a collision between the object and another physics body called "ice4_broken_pieceShape3".
if (apNode->msName == "Shape01") {
return nullptr;
}
iCollideShape *pShape = apWorld->GetPhysicsWorld()->CreateMeshShape(pVtxBuffer);
iPhysicsBody *pBody = apWorld->GetPhysicsWorld()->CreateBody(apNode->msName, pShape);