From 9807e7dadc4b797f17d0d4a761decf341bed9018 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 11 Feb 2011 09:24:59 +0100 Subject: [PATCH] simplified actor-related physics interface to mwscene --- apps/openmw/mwrender/mwscene.cpp | 12 ++++-------- apps/openmw/mwrender/mwscene.hpp | 9 ++------- apps/openmw/mwworld/world.cpp | 3 +-- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index e755e1163..1c2303ce4 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -102,14 +102,15 @@ std::pair MWScene::getFacedHandle (MWWorld::World& world) return std::pair(handle, distance); } -void MWScene::doPhysics (float duration, MWWorld::World& world) +void MWScene::doPhysics (float duration, MWWorld::World& world, + const std::vector >& actors) { // stop changes to world from being reported back to the physics system MWWorld::DoingPhysics scopeGuard; // move object directly for now -> TODO replace with physics - for (std::vector >::const_iterator iter (mMovement.begin()); - iter!=mMovement.end(); ++iter) + for (std::vector >::const_iterator iter (actors.begin()); + iter!=actors.end(); ++iter) { MWWorld::Ptr ptr = world.getPtrViaHandle (iter->first); @@ -121,11 +122,6 @@ void MWScene::doPhysics (float duration, MWWorld::World& world) } } -void MWScene::setMovement (const std::vector >& actors) -{ - mMovement = actors; -} - void MWScene::addObject (const std::string& handle, const std::string& mesh, const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position) { diff --git a/apps/openmw/mwrender/mwscene.hpp b/apps/openmw/mwrender/mwscene.hpp index 6b7f1734b..e974e0342 100644 --- a/apps/openmw/mwrender/mwscene.hpp +++ b/apps/openmw/mwrender/mwscene.hpp @@ -41,8 +41,6 @@ namespace MWRender MWRender::Player *mPlayer; - std::vector > mMovement; - public: MWScene (OEngine::Render::OgreRenderer &_rend); @@ -63,11 +61,8 @@ namespace MWRender std::pair getFacedHandle (MWWorld::World& world); /// Run physics simulation and modify \a world accordingly. - void doPhysics (float duration, MWWorld::World& world); - - /// Inform phyiscs system about desired velocity vectors for actors - /// (in Morrowind coordinates). - void setMovement (const std::vector >& actors); + void doPhysics (float duration, MWWorld::World& world, + const std::vector >& actors); /// Add object to physics system. void addObject (const std::string& handle, const std::string& mesh, diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index bcee87ef6..6be7e12e5 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -847,7 +847,6 @@ namespace MWWorld void World::doPhysics (const std::vector >& actors, float duration) { - mScene.setMovement (actors); - mScene.doPhysics (duration, *this); + mScene.doPhysics (duration, *this, actors); } }