diff --git a/apps/openmw/mwrender/actors.hpp b/apps/openmw/mwrender/actors.hpp index 336465b161..073c5d51f1 100644 --- a/apps/openmw/mwrender/actors.hpp +++ b/apps/openmw/mwrender/actors.hpp @@ -15,7 +15,7 @@ namespace MWRender{ OEngine::Render::OgreRenderer &mRend; std::map mCellSceneNodes; Ogre::SceneNode* mMwRoot; - std::map mAllActors; + std::map mAllActors; @@ -45,6 +45,7 @@ namespace MWRender{ void update (float duration); + /// Updates containing cell for object rendering data void updateObjectCell(const MWWorld::Ptr &ptr); }; } diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp index 630e5932c7..8594e4fe40 100644 --- a/apps/openmw/mwrender/objects.hpp +++ b/apps/openmw/mwrender/objects.hpp @@ -96,6 +96,7 @@ public: void rebuildStaticGeometry(); + /// Updates containing cell for object rendering data void updateObjectCell(const MWWorld::Ptr &ptr); }; } diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index d6a372d102..e618908c18 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -95,6 +95,7 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList void setWaterHeight(const float height); void toggleWater(); + /// Moves object rendering part to proper container /// \param store Cell the object was in previously (\a ptr has already been updated to the new cell). void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::CellStore *store); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index f3fb8b47f8..215fbb30e2 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -552,7 +552,7 @@ namespace MWWorld Ogre::Vector3 vec(x, y, z); CellStore *currCell; - // a bit ugly + /// \todo fix assertion fail on player ptr.getCell() on start if (ptr == mPlayer->getPlayer()) { currCell = mWorldScene->getCurrentCell(); } else { @@ -574,6 +574,8 @@ namespace MWWorld CellStore *newCell = MWBase::Environment::get().getWorld()->getExterior(cellX, cellY); + // placeObject() handles both target cell states + // with active current cell if (!mWorldScene->isCellActive(*currCell)) { placeObject(ptr, *newCell, pos); haveToMove = false; @@ -589,8 +591,6 @@ namespace MWWorld mRendering->moveObjectToCell(copy, vec, currCell); - /// \note Maybe mechanics actors change is redundant - /// because of Ptr comparing operators if (MWWorld::Class::get(ptr).isActor()) { MWMechanics::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager();