void SceneObject::resetWorldBox() { AssertFatal(mObjBox.isValidBox(), "SceneObject::resetWorldBox - Bad object box!"); mWorldBox = mObjBox; mWorldBox.minExtents.convolve(mObjScale); mWorldBox.maxExtents.convolve(mObjScale); mObjToWorld.mul(mWorldBox); AssertFatal(mWorldBox.isValidBox(), "SceneObject::resetWorldBox - Bad world box!"); // Create mWorldSphere from mWorldBox mWorldBox.getCenter(&mWorldSphere.center); mWorldSphere.radius = (mWorldBox.maxExtents - mWorldSphere.center).len(); // Update tracker links. for( SceneObjectLink* link = mSceneObjectLinks; link != NULL; link = link->getNextLink() ) link->update(); }
void SceneObject::resetObjectBox() { AssertFatal( mWorldBox.isValidBox(), "SceneObject::resetObjectBox - Bad world box!" ); mObjBox = mWorldBox; mWorldToObj.mul( mObjBox ); Point3F objScale( mObjScale ); objScale.setMax( Point3F( (F32)POINT_EPSILON, (F32)POINT_EPSILON, (F32)POINT_EPSILON ) ); mObjBox.minExtents.convolveInverse( objScale ); mObjBox.maxExtents.convolveInverse( objScale ); AssertFatal( mObjBox.isValidBox(), "SceneObject::resetObjectBox - Bad object box!" ); // Update the mWorldSphere from mWorldBox mWorldBox.getCenter( &mWorldSphere.center ); mWorldSphere.radius = ( mWorldBox.maxExtents - mWorldSphere.center ).len(); // Update scene managers. for( SceneObjectLink* link = mSceneObjectLinks; link != NULL; link = link->getNextLink() ) link->update(); }