Remove redundant Scene::updatePosition function

This commit is contained in:
elsid 2022-09-17 00:23:38 +02:00
parent aeb4611d6c
commit feb645d15f
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
3 changed files with 3 additions and 12 deletions

View file

@ -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) void Scene::updateObjectRotation(const Ptr &ptr, RotationOrder order)
{ {
const auto rot = makeNodeRotation(ptr, order); const auto rot = makeNodeRotation(ptr, order);

View file

@ -188,7 +188,6 @@ namespace MWWorld
void updateObjectRotation(const Ptr& ptr, RotationOrder order); void updateObjectRotation(const Ptr& ptr, RotationOrder order);
void updateObjectScale(const Ptr& ptr); void updateObjectScale(const Ptr& ptr);
void updateObjectPosition(const Ptr &ptr, const osg::Vec3f &pos, bool movePhysics);
bool isCellActive(const CellStore &cell); bool isCellActive(const CellStore &cell);

View file

@ -1260,10 +1260,11 @@ namespace MWWorld
} }
if (haveToMove && newPtr.getRefData().getBaseNode()) if (haveToMove && newPtr.getRefData().getBaseNode())
{ {
mWorldScene->updateObjectPosition(newPtr, position, movePhysics); mRendering->moveObject(newPtr, position);
if (movePhysics) if (movePhysics)
{ {
if (const auto object = mPhysics->getObject(ptr)) mPhysics->updatePosition(newPtr);
if (const MWPhysics::Object* object = mPhysics->getObject(newPtr))
updateNavigatorObject(*object); updateNavigatorObject(*object);
} }
} }