mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +00:00
Fixes #848: Use hardcoded animation velocity for first person movement
This commit is contained in:
parent
ff11d85a62
commit
6ce499f0e6
@ -315,8 +315,18 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||||||
if(!mCurrentMovement.empty())
|
if(!mCurrentMovement.empty())
|
||||||
{
|
{
|
||||||
float vel, speedmult = 1.0f;
|
float vel, speedmult = 1.0f;
|
||||||
|
|
||||||
|
bool isrunning = mPtr.getClass().getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Run);
|
||||||
|
|
||||||
if(mMovementSpeed > 0.0f && (vel=mAnimation->getVelocity(mCurrentMovement)) > 1.0f)
|
if(mMovementSpeed > 0.0f && (vel=mAnimation->getVelocity(mCurrentMovement)) > 1.0f)
|
||||||
speedmult = mMovementSpeed / vel;
|
speedmult = mMovementSpeed / vel;
|
||||||
|
else if (mMovementState == CharState_TurnLeft || mMovementState == CharState_TurnRight)
|
||||||
|
speedmult = 1.f; // TODO: should get a speed mult depending on the current turning speed
|
||||||
|
else if (mMovementSpeed > 0.0f)
|
||||||
|
// The first person anims don't have any velocity to calculate a speed multiplier from.
|
||||||
|
// We use the third person velocities instead.
|
||||||
|
// FIXME: should be pulled from the actual animation, but it is not presently loaded.
|
||||||
|
speedmult = mMovementSpeed / (isrunning ? 222.857f : 154.064f);
|
||||||
mAnimation->play(mCurrentMovement, Priority_Movement, movegroup, false,
|
mAnimation->play(mCurrentMovement, Priority_Movement, movegroup, false,
|
||||||
speedmult, ((mode!=2)?"start":"loop start"), "stop", 0.0f, ~0ul);
|
speedmult, ((mode!=2)?"start":"loop start"), "stop", 0.0f, ~0ul);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user