mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Merge pull request #341 from lukaspj/fix/break-shape-invalid-box
breakShape() - remove parts created with invalid object box .
This commit is contained in:
commit
2dae903a18
1 changed files with 15 additions and 5 deletions
|
|
@ -108,12 +108,22 @@ void TSPartInstance::breakShape(TSShapeInstance * shape, S32 subShape, Vector<TS
|
||||||
for (S32 i=0; i<partList.size(); i++)
|
for (S32 i=0; i<partList.size(); i++)
|
||||||
{
|
{
|
||||||
if (partList[i]->mMeshObjects.size())
|
if (partList[i]->mMeshObjects.size())
|
||||||
partList[i]->updateBounds();
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
partList.erase(i);
|
partList[i]->updateBounds();
|
||||||
i--;
|
// 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--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue