Fix not completely correct camera transition when switching from 1st person to 3rd person if armed.

pull/579/head
Petr Mikheev 5 years ago
parent d78b227670
commit 62c8ea373b

@ -110,19 +110,21 @@ namespace MWInput
if (MWBase::Environment::get().getInputManager()->getControlSwitch("playerviewswitch"))
{
const float switchLimit = 0.25;
MWBase::World* world = MWBase::Environment::get().getWorld();
if (mBindingsManager->actionIsActive(A_TogglePOV))
{
if (mPreviewPOVDelay == 0)
MWBase::Environment::get().getWorld()->togglePreviewMode(true);
if (world->isFirstPerson() ? mPreviewPOVDelay > switchLimit : mPreviewPOVDelay == 0)
world->togglePreviewMode(true);
mPreviewPOVDelay += dt;
}
else
{
//disable preview mode
if (mPreviewPOVDelay > 0)
MWBase::Environment::get().getWorld()->togglePreviewMode(false);
if (mPreviewPOVDelay > 0.f && mPreviewPOVDelay <= 0.25)
MWBase::Environment::get().getWorld()->togglePOV();
world->togglePreviewMode(false);
if (mPreviewPOVDelay > 0.f && mPreviewPOVDelay <= switchLimit)
world->togglePOV();
mPreviewPOVDelay = 0.f;
}
}

@ -287,6 +287,7 @@ namespace MWRender
mFirstPersonView = !mFirstPersonView;
updateStandingPreviewMode();
instantTransition();
processViewChange();
}
@ -337,6 +338,8 @@ namespace MWRender
mMode = enable ? Mode::Preview : Mode::Normal;
if (mMode == Mode::Normal)
updateStandingPreviewMode();
else if (mFirstPersonView)
instantTransition();
if (mMode == Mode::Normal)
{
if (!mDeferredRotationAllowed)

Loading…
Cancel
Save