|
|
|
@ -29,7 +29,7 @@ void Objects::setRootNode(Ogre::SceneNode* root)
|
|
|
|
|
mRootNode = root;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_)
|
|
|
|
|
void Objects::insertBegin (const MWWorld::Ptr& ptr)
|
|
|
|
|
{
|
|
|
|
|
Ogre::SceneNode* root = mRootNode;
|
|
|
|
|
Ogre::SceneNode* cellnode;
|
|
|
|
@ -66,10 +66,7 @@ void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_)
|
|
|
|
|
// Rotates first around z, then y, then x
|
|
|
|
|
insert->setOrientation(xr*yr*zr);
|
|
|
|
|
|
|
|
|
|
if (!enabled)
|
|
|
|
|
insert->setVisible (false);
|
|
|
|
|
ptr.getRefData().setBaseNode(insert);
|
|
|
|
|
mIsStatic = static_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
@ -77,7 +74,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
|
|
|
|
|
assert(insert);
|
|
|
|
|
|
|
|
|
|
std::auto_ptr<ObjectAnimation> anim(new ObjectAnimation(ptr, mesh, mIsStatic));
|
|
|
|
|
std::auto_ptr<ObjectAnimation> anim(new ObjectAnimation(ptr, mesh));
|
|
|
|
|
|
|
|
|
|
Ogre::AxisAlignedBox bounds = anim->getWorldBounds();
|
|
|
|
|
Ogre::Vector3 extents = bounds.getSize();
|
|
|
|
@ -97,7 +94,9 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
if(ptr.getTypeName() == typeid(ESM::Light).name())
|
|
|
|
|
anim->addLight(ptr.get<ESM::Light>()->mBase);
|
|
|
|
|
|
|
|
|
|
if(mIsStatic && Settings::Manager::getBool("use static geometry", "Objects") && anim->canBatch())
|
|
|
|
|
if(ptr.getTypeName() == typeid(ESM::Static).name() &&
|
|
|
|
|
Settings::Manager::getBool("use static geometry", "Objects") &&
|
|
|
|
|
anim->canBatch())
|
|
|
|
|
{
|
|
|
|
|
Ogre::StaticGeometry* sg = 0;
|
|
|
|
|
|
|
|
|
|