1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:53:52 +00:00

Merge branch 'objects_can_move_too' into 'master'

Another fallout from MR 722: restore objects handling

See merge request OpenMW/openmw!749
This commit is contained in:
psi29a 2021-04-16 14:38:48 +00:00
commit 0b8cae4af8

View file

@ -1256,12 +1256,14 @@ namespace MWWorld
MWWorld::Ptr World::moveObjectBy(const Ptr& ptr, osg::Vec3f vec, bool moveToActive)
{
auto* actor = mPhysics->getActor(ptr);
if (actor)
actor->adjustPosition(vec);
osg::Vec3f newpos = ptr.getRefData().getPosition().asVec3() + vec;
if (actor)
{
actor->adjustPosition(vec);
return moveObject(ptr, newpos.x(), newpos.y(), newpos.z(), false, moveToActive && ptr != getPlayerPtr());
}
return moveObject(ptr, newpos.x(), newpos.y(), newpos.z());
}
void World::scaleObject (const Ptr& ptr, float scale)
{