diff --git a/apps/openmw/mwrender/camera.cpp b/apps/openmw/mwrender/camera.cpp index 1e6ea2843e..7531e712b5 100644 --- a/apps/openmw/mwrender/camera.cpp +++ b/apps/openmw/mwrender/camera.cpp @@ -67,6 +67,7 @@ namespace MWRender mFocalPointTransitionSpeedCoef(1.f), mPreviousTransitionInfluence(0.f), mSmoothedSpeed(0.f), + mZoomOutWhenMoveCoef(Settings::Manager::getFloat("zoom out when move coef", "Camera")), mDynamicCameraDistanceEnabled(false), mShowCrosshairInThirdPersonMode(false) { @@ -461,7 +462,7 @@ namespace MWRender float pitchCorrection = std::max(-getPitch(), 0.f) * 50.f; float smoothedSpeedSqr = mSmoothedSpeed * mSmoothedSpeed; - float speedCorrection = smoothedSpeedSqr / (smoothedSpeedSqr + 300.f*300.f) * 20.0f; + float speedCorrection = smoothedSpeedSqr / (smoothedSpeedSqr + 300.f*300.f) * mZoomOutWhenMoveCoef; return pitchCorrection + speedCorrection; } diff --git a/apps/openmw/mwrender/camera.hpp b/apps/openmw/mwrender/camera.hpp index bd70d6d9a1..59fa53047a 100644 --- a/apps/openmw/mwrender/camera.hpp +++ b/apps/openmw/mwrender/camera.hpp @@ -67,6 +67,7 @@ namespace MWRender osg::Vec2d mPreviousExtraOffset; float mSmoothedSpeed; + float mZoomOutWhenMoveCoef; bool mDynamicCameraDistanceEnabled; bool mShowCrosshairInThirdPersonMode; diff --git a/docs/source/reference/modding/settings/camera.rst b/docs/source/reference/modding/settings/camera.rst index 21fec8fd60..be636cef4f 100644 --- a/docs/source/reference/modding/settings/camera.rst +++ b/docs/source/reference/modding/settings/camera.rst @@ -162,3 +162,15 @@ When player is close to an obstacle, automatically switches camera to the should This setting can only be configured by editing the settings configuration file. +zoom out when move coef +----------------------- + +:Type: floating point +:Range: Any +:Default: 20 + +This setting makes difference only in third person mode if 'view over shoulder' is enabled. +Slightly pulls camera away (or closer in case of negative value) when the character moves. To disable set it to zero. + +This setting can only be configured by editing the settings configuration file. + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index b960946d82..35be128a89 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -45,6 +45,9 @@ view over shoulder offset = 30 -10 # Switch shoulder automatically when player is close to an obstacle. auto switch shoulder = true +# Slightly pulls camera away when the character moves. Works only in 'view over shoulder' mode. Set to 0 to disable. +zoom out when move coef = 20 + [Cells] # Preload cells in a background thread. All settings starting with 'preload' have no effect unless this is enabled.