mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 06:45:35 +00:00
Cap movement animation playback speed
This commit is contained in:
parent
7a6ba8bf7a
commit
ece0db4f82
1 changed files with 6 additions and 2 deletions
|
@ -2289,8 +2289,12 @@ void CharacterController::update(float duration, bool animationOnly)
|
||||||
}
|
}
|
||||||
else if (mMovementState != CharState_None && mAdjustMovementAnimSpeed)
|
else if (mMovementState != CharState_None && mAdjustMovementAnimSpeed)
|
||||||
{
|
{
|
||||||
float speedmult = speed / mMovementAnimSpeed;
|
// Vanilla caps the played animation speed.
|
||||||
mAnimation->adjustSpeedMult(mCurrentMovement, speedmult);
|
const float maxSpeedMult = 10.f;
|
||||||
|
const float speedMult = speed / mMovementAnimSpeed;
|
||||||
|
mAnimation->adjustSpeedMult(mCurrentMovement, std::min(maxSpeedMult, speedMult));
|
||||||
|
// Make sure the actual speed is the "expected" speed even though the animation is slower
|
||||||
|
scale *= std::max(1.f, speedMult / maxSpeedMult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mSkipAnim)
|
if (!mSkipAnim)
|
||||||
|
|
Loading…
Reference in a new issue