Merge pull request #341 from lukaspj/fix/break-shape-invalid-box

breakShape() - remove parts created with invalid object box .
This commit is contained in:
Brian Roberts 2020-10-03 17:47:47 -05:00 committed by GitHub
commit 2dae903a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,12 +108,22 @@ void TSPartInstance::breakShape(TSShapeInstance * shape, S32 subShape, Vector<TS
for (S32 i=0; i<partList.size(); i++)
{
if (partList[i]->mMeshObjects.size())
partList[i]->updateBounds();
else
{
partList.erase(i);
i--;
}
partList[i]->updateBounds();
// Remove any parts parts with invalid box
Box3F box = partList[i]->getBounds();
if (!box.isValidBox())
{
Con::warnf("TSPartInstance::breakShape - part created with invalid object box. Removing from list.");
partList.erase(i);
i--;
}
}
else
{
partList.erase(i);
i--;
}
}
}