| 97 | //------------------------------------------------------------------------------------- |
| 98 | |
| 99 | void TSPartInstance::breakShape(TSShapeInstance * shape, S32 subShape, Vector<TSPartInstance*> & partList, F32 * probShatter, F32 * probBreak, S32 probDepth) |
| 100 | { |
| 101 | AssertFatal(subShape>=0 && subShape<shape->mShape->subShapeFirstNode.size(),"TSPartInstance::breakShape: subShape out of range."); |
| 102 | |
| 103 | S32 start = shape->mShape->subShapeFirstNode[subShape]; |
| 104 | |
| 105 | TSPartInstance::breakShape(shape, NULL, start, partList, probShatter, probBreak, probDepth); |
| 106 | |
| 107 | // update bounds (and get rid of empty parts) |
| 108 | for (S32 i=0; i<partList.size(); i++) |
| 109 | { |
| 110 | if (partList[i]->mMeshObjects.size()) |
| 111 | { |
| 112 | partList[i]->updateBounds(); |
| 113 | // Remove any parts parts with invalid box |
| 114 | Box3F box = partList[i]->getBounds(); |
| 115 | if (!box.isValidBox()) |
| 116 | { |
| 117 | Con::warnf("TSPartInstance::breakShape - part created with invalid object box. Removing from list."); |
| 118 | partList.erase(i); |
| 119 | i--; |
| 120 | } |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | partList.erase(i); |
| 125 | i--; |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | void TSPartInstance::breakShape(TSShapeInstance * shape, TSPartInstance * currentPart, S32 currentNode, Vector<TSPartInstance*> & partList, F32 * probShatter, F32 * probBreak, S32 probDepth) |
| 131 | { |
nothing calls this directly
no test coverage detected