mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 13:23:52 +00:00
Fix not completely correct camera transition when switching from 1st person to 3rd person if armed.
This commit is contained in:
parent
d78b227670
commit
62c8ea373b
2 changed files with 10 additions and 5 deletions
|
@ -110,19 +110,21 @@ namespace MWInput
|
||||||
|
|
||||||
if (MWBase::Environment::get().getInputManager()->getControlSwitch("playerviewswitch"))
|
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 (mBindingsManager->actionIsActive(A_TogglePOV))
|
||||||
{
|
{
|
||||||
if (mPreviewPOVDelay == 0)
|
if (world->isFirstPerson() ? mPreviewPOVDelay > switchLimit : mPreviewPOVDelay == 0)
|
||||||
MWBase::Environment::get().getWorld()->togglePreviewMode(true);
|
world->togglePreviewMode(true);
|
||||||
mPreviewPOVDelay += dt;
|
mPreviewPOVDelay += dt;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//disable preview mode
|
//disable preview mode
|
||||||
if (mPreviewPOVDelay > 0)
|
if (mPreviewPOVDelay > 0)
|
||||||
MWBase::Environment::get().getWorld()->togglePreviewMode(false);
|
world->togglePreviewMode(false);
|
||||||
if (mPreviewPOVDelay > 0.f && mPreviewPOVDelay <= 0.25)
|
if (mPreviewPOVDelay > 0.f && mPreviewPOVDelay <= switchLimit)
|
||||||
MWBase::Environment::get().getWorld()->togglePOV();
|
world->togglePOV();
|
||||||
mPreviewPOVDelay = 0.f;
|
mPreviewPOVDelay = 0.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,6 +287,7 @@ namespace MWRender
|
||||||
|
|
||||||
mFirstPersonView = !mFirstPersonView;
|
mFirstPersonView = !mFirstPersonView;
|
||||||
updateStandingPreviewMode();
|
updateStandingPreviewMode();
|
||||||
|
instantTransition();
|
||||||
processViewChange();
|
processViewChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,6 +338,8 @@ namespace MWRender
|
||||||
mMode = enable ? Mode::Preview : Mode::Normal;
|
mMode = enable ? Mode::Preview : Mode::Normal;
|
||||||
if (mMode == Mode::Normal)
|
if (mMode == Mode::Normal)
|
||||||
updateStandingPreviewMode();
|
updateStandingPreviewMode();
|
||||||
|
else if (mFirstPersonView)
|
||||||
|
instantTransition();
|
||||||
if (mMode == Mode::Normal)
|
if (mMode == Mode::Normal)
|
||||||
{
|
{
|
||||||
if (!mDeferredRotationAllowed)
|
if (!mDeferredRotationAllowed)
|
||||||
|
|
Loading…
Reference in a new issue