forked from mirror/openmw-tes3mp
Merged pull request #1666
This commit is contained in:
commit
1cfc1f9bdb
3 changed files with 31 additions and 14 deletions
|
@ -84,6 +84,7 @@
|
|||
Bug #4563: Fast travel price logic checks destination cell instead of service actor cell
|
||||
Bug #4565: Underwater view distance should be limited
|
||||
Bug #4573: Player uses headtracking in the 1st-person mode
|
||||
Bug #4574: Player turning animations are twitchy
|
||||
Bug #4575: Weird result of attack animation blending with movement animations
|
||||
Bug #4576: Reset of idle animations when attack can not be started
|
||||
Feature #2606: Editor: Implemented (optional) case sensitive global search
|
||||
|
|
|
@ -1992,25 +1992,37 @@ void CharacterController::update(float duration)
|
|||
else if(rot.z() != 0.0f && !sneak && !(mPtr == getPlayer() && MWBase::Environment::get().getWorld()->isFirstPerson()))
|
||||
{
|
||||
if(rot.z() > 0.0f)
|
||||
{
|
||||
movestate = inwater ? CharState_SwimTurnRight : CharState_TurnRight;
|
||||
mAnimation->disable(mCurrentJump);
|
||||
}
|
||||
else if(rot.z() < 0.0f)
|
||||
{
|
||||
movestate = inwater ? CharState_SwimTurnLeft : CharState_TurnLeft;
|
||||
mAnimation->disable(mCurrentJump);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mTurnAnimationThreshold -= duration;
|
||||
if (isTurning())
|
||||
mTurnAnimationThreshold = 0.05f;
|
||||
else if (movestate == CharState_None && isTurning()
|
||||
&& mTurnAnimationThreshold > 0)
|
||||
// Player can not use smooth turning as NPCs, so we play turning animation a bit to avoid jittering
|
||||
if (mPtr == getPlayer())
|
||||
{
|
||||
movestate = mMovementState;
|
||||
float threshold = mCurrentMovement.find("swim") == std::string::npos ? 0.4f : 0.8f;
|
||||
float complete;
|
||||
bool animPlaying = mAnimation->getInfo(mCurrentMovement, &complete);
|
||||
if (movestate == CharState_None && isTurning())
|
||||
{
|
||||
if (animPlaying && complete < threshold)
|
||||
movestate = mMovementState;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mTurnAnimationThreshold -= duration;
|
||||
if (movestate == CharState_TurnRight || movestate == CharState_TurnLeft ||
|
||||
movestate == CharState_SwimTurnRight || movestate == CharState_SwimTurnLeft)
|
||||
{
|
||||
mTurnAnimationThreshold = 0.05f;
|
||||
}
|
||||
else if (movestate == CharState_None && isTurning()
|
||||
&& mTurnAnimationThreshold > 0)
|
||||
{
|
||||
movestate = mMovementState;
|
||||
}
|
||||
}
|
||||
|
||||
if(movestate != CharState_None && !isTurning())
|
||||
|
@ -2040,8 +2052,10 @@ void CharacterController::update(float duration)
|
|||
|
||||
if (isTurning())
|
||||
{
|
||||
// Adjust animation speed from 1.0 to 1.5 multiplier
|
||||
float turnSpeed = std::min(1.5f, std::abs(rot.z()) / duration / static_cast<float>(osg::PI));
|
||||
if (duration > 0)
|
||||
mAnimation->adjustSpeedMult(mCurrentMovement, std::min(1.5f, std::abs(rot.z()) / duration / static_cast<float>(osg::PI)));
|
||||
mAnimation->adjustSpeedMult(mCurrentMovement, std::max(turnSpeed, 1.0f));
|
||||
}
|
||||
else if (mMovementState != CharState_None && mAdjustMovementAnimSpeed)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,10 @@ enum Priority {
|
|||
Priority_WeaponLowerBody,
|
||||
Priority_SneakIdleLowerBody,
|
||||
Priority_SwimIdle,
|
||||
Priority_Jump,
|
||||
Priority_Movement,
|
||||
// Note: in vanilla movement anims have higher priority than jump ones.
|
||||
// It causes issues with landing animations during movement.
|
||||
Priority_Jump,
|
||||
Priority_Hit,
|
||||
Priority_Weapon,
|
||||
Priority_Block,
|
||||
|
|
Loading…
Reference in a new issue