From c11b3a57c1fef17f31ea14c0decedf0050647926 Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Sat, 5 Nov 2011 14:57:33 -0400 Subject: [PATCH] Made buildStaticGeometry function --- apps/openmw/mwrender/objects.cpp | 9 ++++++++- apps/openmw/mwrender/objects.hpp | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index 429dae71d7..0632255be5 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -93,7 +93,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh){ sg->addEntity(ent,insert->_getDerivedPosition(),insert->_getDerivedOrientation(),insert->_getDerivedScale()); sg->setRegionDimensions(Ogre::Vector3(100000,10000,100000)); - sg->build(); //Is this the right place for building? + mRend.getScene()->destroyEntity(ent); } @@ -159,4 +159,11 @@ void Objects::removeCell(const MWWorld::Ptr& ptr){ sg = 0; } } +void Objects::buildStaticGeometry(const MWWorld::Ptr& ptr){ + if(mSG.find(ptr.getCell()) != mSG.end()) + { + Ogre::StaticGeometry* sg = mSG[ptr.getCell()]; + sg->build(); + } +} diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp index da21300b7d..ebb52906a7 100644 --- a/apps/openmw/mwrender/objects.hpp +++ b/apps/openmw/mwrender/objects.hpp @@ -34,6 +34,8 @@ public: void insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, float radius); void deleteObject (const std::string& handle); void removeCell(const MWWorld::Ptr& ptr); + void buildStaticGeometry(const MWWorld::Ptr& ptr); + /// insert a light related to the most recent insertBegin call.