mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 08:37:12 +00:00
Follow up MR 722: do not apply mPositionOffset twice when we teleport.
Previous MR change the meaning of mPositionOffset: it is now just a log of relative movement that were already applied to allow the physics simulation to catch up, instead of changes that needs to be applied. As such, after a teleport we need to reset it. Also, since mWorldPosition is already with the offset we should not update its value in applyPositionOffset().
This commit is contained in:
parent
4f72fa2615
commit
e31cf7e6ac
@ -121,6 +121,7 @@ void Actor::updatePosition()
|
||||
mPreviousPosition = mWorldPosition;
|
||||
mPosition = mWorldPosition;
|
||||
mSimulationPosition = mWorldPosition;
|
||||
mPositionOffset = osg::Vec3f();
|
||||
mStandingOnPtr = nullptr;
|
||||
mSkipSimulation = true;
|
||||
}
|
||||
@ -196,7 +197,6 @@ void Actor::applyOffsetChange()
|
||||
{
|
||||
if (mPositionOffset.length() == 0)
|
||||
return;
|
||||
mWorldPosition += mPositionOffset;
|
||||
mPosition += mPositionOffset;
|
||||
mPreviousPosition += mPositionOffset;
|
||||
mSimulationPosition += mPositionOffset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user