|
|
|
@ -29,7 +29,7 @@ void Objects::setRootNode(Ogre::SceneNode* root)
|
|
|
|
|
mRootNode = root;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Objects::insertBegin (const MWWorld::Ptr& ptr)
|
|
|
|
|
void Objects::insertBegin(const MWWorld::Ptr& ptr)
|
|
|
|
|
{
|
|
|
|
|
Ogre::SceneNode* root = mRootNode;
|
|
|
|
|
Ogre::SceneNode* cellnode;
|
|
|
|
@ -69,16 +69,15 @@ void Objects::insertBegin (const MWWorld::Ptr& ptr)
|
|
|
|
|
ptr.getRefData().setBaseNode(insert);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
|
|
|
|
|
{
|
|
|
|
|
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
|
|
|
|
|
assert(insert);
|
|
|
|
|
insertBegin(ptr);
|
|
|
|
|
|
|
|
|
|
std::auto_ptr<ObjectAnimation> anim(new ObjectAnimation(ptr, mesh));
|
|
|
|
|
|
|
|
|
|
Ogre::AxisAlignedBox bounds = anim->getWorldBounds();
|
|
|
|
|
Ogre::Vector3 extents = bounds.getSize();
|
|
|
|
|
extents *= insert->getScale();
|
|
|
|
|
extents *= ptr.getRefData().getBaseNode()->getScale();
|
|
|
|
|
float size = std::max(std::max(extents.x, extents.y), extents.z);
|
|
|
|
|
|
|
|
|
|
bool small = (size < Settings::Manager::getInt("small object size", "Viewing distance")) &&
|
|
|
|
|