1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 18:32:36 +00:00

Merge branch 'bigboi' into 'master'

Force a scale update when changing view modes

Closes #6623

See merge request OpenMW/openmw!1662
This commit is contained in:
Alexei Kotov 2022-02-16 22:29:13 +00:00
commit 4fdf55601c
4 changed files with 6 additions and 6 deletions

View File

@ -293,7 +293,7 @@ namespace MWBase
virtual MWWorld::Ptr moveObjectBy(const MWWorld::Ptr &ptr, const osg::Vec3f& vec) = 0;
///< @return an updated Ptr
virtual void scaleObject (const MWWorld::Ptr& ptr, float scale) = 0;
virtual void scaleObject (const MWWorld::Ptr& ptr, float scale, bool force = false) = 0;
virtual void rotateObject(const MWWorld::Ptr& ptr, const osg::Vec3f& rot, RotationFlags flags = RotationFlag_inverseOrder) = 0;

View File

@ -296,7 +296,7 @@ void NpcAnimation::setViewMode(NpcAnimation::ViewMode viewMode)
return;
mViewMode = viewMode;
MWBase::Environment::get().getWorld()->scaleObject(mPtr, mPtr.getCellRef().getScale()); // apply race height after view change
MWBase::Environment::get().getWorld()->scaleObject(mPtr, mPtr.getCellRef().getScale(), true); // apply race height after view change
mAmmunition.reset();
rebuild();

View File

@ -1281,9 +1281,9 @@ namespace MWWorld
return moveObject(ptr, newpos);
}
void World::scaleObject (const Ptr& ptr, float scale)
void World::scaleObject (const Ptr& ptr, float scale, bool force)
{
if (scale == ptr.getCellRef().getScale())
if (!force && scale == ptr.getCellRef().getScale())
return;
if (mPhysics->getActor(ptr))
mNavigator->removeAgent(getPathfindingHalfExtents(ptr));
@ -2482,7 +2482,7 @@ namespace MWWorld
player.getClass().getInventoryStore(player).setInvListener(anim, player);
player.getClass().getInventoryStore(player).setContListener(anim);
scaleObject(player, player.getCellRef().getScale()); // apply race height
scaleObject(player, player.getCellRef().getScale(), true); // apply race height
rotateObject(player, osg::Vec3f(), MWBase::RotationFlag_inverseOrder | MWBase::RotationFlag_adjust);
MWBase::Environment::get().getMechanicsManager()->add(getPlayerPtr());

View File

@ -377,7 +377,7 @@ namespace MWWorld
MWWorld::Ptr moveObjectBy(const Ptr& ptr, const osg::Vec3f& vec) override;
///< @return an updated Ptr
void scaleObject (const Ptr& ptr, float scale) override;
void scaleObject (const Ptr& ptr, float scale, bool force = false) override;
/// World rotates object, uses radians
/// @note Rotations via this method use a different rotation order than the initial rotations in the CS. This