| 74 | } |
| 75 | |
| 76 | void TSPartInstance::updateBounds() |
| 77 | { |
| 78 | // run through meshes and brute force it? |
| 79 | Box3F bounds; |
| 80 | mBounds.minExtents.set( 10E30f, 10E30f, 10E30f); |
| 81 | mBounds.maxExtents.set(-10E30f,-10E30f,-10E30f); |
| 82 | for (S32 i=0; i<mMeshObjects.size(); i++) |
| 83 | { |
| 84 | if (mMeshObjects[i]->getMesh(0)) |
| 85 | mMeshObjects[i]->getMesh(0)->computeBounds(mMeshObjects[i]->getTransform(),bounds,mMeshObjects[i]->frame); |
| 86 | mBounds.minExtents.setMin(bounds.minExtents); |
| 87 | mBounds.maxExtents.setMax(bounds.maxExtents); |
| 88 | } |
| 89 | mCenter = mBounds.minExtents + mBounds.maxExtents; |
| 90 | mCenter *= 0.5f; |
| 91 | Point3F r = mBounds.maxExtents-mCenter; |
| 92 | mRadius = mSqrt(mDot(r,r)); |
| 93 | } |
| 94 | |
| 95 | //------------------------------------------------------------------------------------- |
| 96 | // Methods for breaking shapes into pieces |
no test coverage detected