From feb645d15fedbc2c421e9e1b4421e40d043b3e48 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 17 Sep 2022 00:23:38 +0200 Subject: [PATCH] Remove redundant Scene::updatePosition function --- apps/openmw/mwworld/scene.cpp | 9 --------- apps/openmw/mwworld/scene.hpp | 1 - apps/openmw/mwworld/worldimp.cpp | 5 +++-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 2c5850e4d2..451102c50e 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -286,15 +286,6 @@ namespace MWWorld } } - void Scene::updateObjectPosition(const Ptr &ptr, const osg::Vec3f &pos, bool movePhysics) - { - mRendering.moveObject(ptr, pos); - if (movePhysics) - { - mPhysics->updatePosition(ptr); - } - } - void Scene::updateObjectRotation(const Ptr &ptr, RotationOrder order) { const auto rot = makeNodeRotation(ptr, order); diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp index f0246f0882..d1f8611ea4 100644 --- a/apps/openmw/mwworld/scene.hpp +++ b/apps/openmw/mwworld/scene.hpp @@ -188,7 +188,6 @@ namespace MWWorld void updateObjectRotation(const Ptr& ptr, RotationOrder order); void updateObjectScale(const Ptr& ptr); - void updateObjectPosition(const Ptr &ptr, const osg::Vec3f &pos, bool movePhysics); bool isCellActive(const CellStore &cell); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index e5be728360..4f770a53bb 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1260,10 +1260,11 @@ namespace MWWorld } if (haveToMove && newPtr.getRefData().getBaseNode()) { - mWorldScene->updateObjectPosition(newPtr, position, movePhysics); + mRendering->moveObject(newPtr, position); if (movePhysics) { - if (const auto object = mPhysics->getObject(ptr)) + mPhysics->updatePosition(newPtr); + if (const MWPhysics::Object* object = mPhysics->getObject(newPtr)) updateNavigatorObject(*object); } }