mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 04:45:36 +00:00
Fix #5743
This commit is contained in:
parent
fd5429ae56
commit
8b3088a9e5
1 changed files with 8 additions and 7 deletions
|
@ -2265,18 +2265,19 @@ void CharacterController::update(float duration, bool animationOnly)
|
||||||
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
|
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (turnToMovementDirection)
|
if (turnToMovementDirection && !isFirstPersonPlayer &&
|
||||||
|
(movestate == CharState_SwimRunForward || movestate == CharState_SwimWalkForward ||
|
||||||
|
movestate == CharState_SwimRunBack || movestate == CharState_SwimWalkBack))
|
||||||
{
|
{
|
||||||
float targetSwimmingPitch;
|
|
||||||
if (inwater && vec.y() != 0 && !isFirstPersonPlayer && !movementSettings.mIsStrafing)
|
|
||||||
targetSwimmingPitch = -mPtr.getRefData().getPosition().rot[0];
|
|
||||||
else
|
|
||||||
targetSwimmingPitch = 0;
|
|
||||||
float maxSwimPitchDelta = 3.0f * duration;
|
|
||||||
float swimmingPitch = mAnimation->getBodyPitchRadians();
|
float swimmingPitch = mAnimation->getBodyPitchRadians();
|
||||||
|
float targetSwimmingPitch = -mPtr.getRefData().getPosition().rot[0];
|
||||||
|
float maxSwimPitchDelta = 3.0f * duration;
|
||||||
swimmingPitch += osg::clampBetween(targetSwimmingPitch - swimmingPitch, -maxSwimPitchDelta, maxSwimPitchDelta);
|
swimmingPitch += osg::clampBetween(targetSwimmingPitch - swimmingPitch, -maxSwimPitchDelta, maxSwimPitchDelta);
|
||||||
mAnimation->setBodyPitchRadians(swimmingPitch);
|
mAnimation->setBodyPitchRadians(swimmingPitch);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
mAnimation->setBodyPitchRadians(0);
|
||||||
|
|
||||||
static const bool swimUpwardCorrection = Settings::Manager::getBool("swim upward correction", "Game");
|
static const bool swimUpwardCorrection = Settings::Manager::getBool("swim upward correction", "Game");
|
||||||
if (inwater && isPlayer && !isFirstPersonPlayer && swimUpwardCorrection)
|
if (inwater && isPlayer && !isFirstPersonPlayer && swimUpwardCorrection)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue