diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index 2dd7d07c1..e82afc303 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -119,15 +119,22 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game"); loadSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game"); loadSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game"); + loadSettingBool(swimUpwardCorrectionCheckBox, "swim upward correction", "Game"); int unarmedFactorsStrengthIndex = mEngineSettings.getInt("strength influences hand to hand", "Game"); if (unarmedFactorsStrengthIndex >= 0 && unarmedFactorsStrengthIndex <= 2) unarmedFactorsStrengthComboBox->setCurrentIndex(unarmedFactorsStrengthIndex); loadSettingBool(stealingFromKnockedOutCheckBox, "always allow stealing from knocked out actors", "Game"); + loadSettingBool(enableNavigatorCheckBox, "enable", "Navigator"); } // Visuals { + loadSettingBool(autoUseObjectNormalMapsCheckBox, "auto use object normal maps", "Shaders"); + loadSettingBool(autoUseObjectSpecularMapsCheckBox, "auto use object specular maps", "Shaders"); + loadSettingBool(autoUseTerrainNormalMapsCheckBox, "auto use terrain normal maps", "Shaders"); + loadSettingBool(autoUseTerrainSpecularMapsCheckBox, "auto use terrain specular maps", "Shaders"); loadSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders"); + loadSettingBool(radialFogCheckBox, "radial fog", "Shaders"); loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool))); loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); @@ -136,7 +143,6 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); } - loadSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera"); loadSettingBool(turnToMovementDirectionCheckBox, "turn to movement direction", "Game"); const bool distantTerrain = mEngineSettings.getBool("distant terrain", "Terrain"); @@ -149,6 +155,18 @@ bool Launcher::AdvancedPage::loadSettings() viewingDistanceComboBox->setValue(convertToCells(mEngineSettings.getInt("viewing distance", "Camera"))); } + // Camera + { + loadSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera"); + connect(viewOverShoulderCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotViewOverShoulderToggled(bool))); + viewOverShoulderGroup->setEnabled(viewOverShoulderCheckBox->checkState()); + loadSettingBool(autoSwitchShoulderCheckBox, "auto switch shoulder", "Camera"); + loadSettingBool(previewIfStandStillCheckBox, "preview if stand still", "Camera"); + loadSettingBool(deferredPreviewRotationCheckBox, "deferred preview rotation", "Camera"); + defaultShoulderComboBox->setCurrentIndex( + mEngineSettings.getVector2("view over shoulder offset", "Camera").x() >= 0 ? 0 : 1); + } + // Interface Changes { loadSettingBool(showEffectDurationCheckBox, "show effect duration", "Game"); @@ -213,20 +231,26 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game"); saveSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game"); saveSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game"); + saveSettingBool(swimUpwardCorrectionCheckBox, "swim upward correction", "Game"); int unarmedFactorsStrengthIndex = unarmedFactorsStrengthComboBox->currentIndex(); if (unarmedFactorsStrengthIndex != mEngineSettings.getInt("strength influences hand to hand", "Game")) mEngineSettings.setInt("strength influences hand to hand", "Game", unarmedFactorsStrengthIndex); saveSettingBool(stealingFromKnockedOutCheckBox, "always allow stealing from knocked out actors", "Game"); + saveSettingBool(enableNavigatorCheckBox, "enable", "Navigator"); } // Visuals { + saveSettingBool(autoUseObjectNormalMapsCheckBox, "auto use object normal maps", "Shaders"); + saveSettingBool(autoUseObjectSpecularMapsCheckBox, "auto use object specular maps", "Shaders"); + saveSettingBool(autoUseTerrainNormalMapsCheckBox, "auto use terrain normal maps", "Shaders"); + saveSettingBool(autoUseTerrainSpecularMapsCheckBox, "auto use terrain specular maps", "Shaders"); saveSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders"); + saveSettingBool(radialFogCheckBox, "radial fog", "Shaders"); saveSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game"); saveSettingBool(animSourcesCheckBox, "use additional anim sources", "Game"); saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); - saveSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera"); saveSettingBool(turnToMovementDirectionCheckBox, "turn to movement direction", "Game"); const bool distantTerrain = mEngineSettings.getBool("distant terrain", "Terrain"); @@ -245,6 +269,24 @@ void Launcher::AdvancedPage::saveSettings() } } + // Camera + { + saveSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera"); + saveSettingBool(autoSwitchShoulderCheckBox, "auto switch shoulder", "Camera"); + saveSettingBool(previewIfStandStillCheckBox, "preview if stand still", "Camera"); + saveSettingBool(deferredPreviewRotationCheckBox, "deferred preview rotation", "Camera"); + + osg::Vec2f shoulderOffset = mEngineSettings.getVector2("view over shoulder offset", "Camera"); + if (defaultShoulderComboBox->currentIndex() != (shoulderOffset.x() >= 0 ? 0 : 1)) + { + if (defaultShoulderComboBox->currentIndex() == 0) + shoulderOffset.x() = std::abs(shoulderOffset.x()); + else + shoulderOffset.x() = -std::abs(shoulderOffset.x()); + mEngineSettings.setVector2("view over shoulder offset", "Camera", shoulderOffset); + } + } + // Interface Changes { saveSettingBool(showEffectDurationCheckBox, "show effect duration", "Game"); @@ -326,3 +368,8 @@ void Launcher::AdvancedPage::slotAnimSourcesToggled(bool checked) shieldSheathingCheckBox->setCheckState(Qt::Unchecked); } } + +void Launcher::AdvancedPage::slotViewOverShoulderToggled(bool checked) +{ + viewOverShoulderGroup->setEnabled(viewOverShoulderCheckBox->checkState()); +} diff --git a/apps/launcher/advancedpage.hpp b/apps/launcher/advancedpage.hpp index 25cb66d9d..bdf5af0c8 100644 --- a/apps/launcher/advancedpage.hpp +++ b/apps/launcher/advancedpage.hpp @@ -32,6 +32,7 @@ namespace Launcher void on_skipMenuCheckBox_stateChanged(int state); void on_runScriptAfterStartupBrowseButton_clicked(); void slotAnimSourcesToggled(bool checked); + void slotViewOverShoulderToggled(bool checked); private: Files::ConfigurationManager &mCfgMgr; diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index c8e81aa49..2ff8241f4 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2243,7 +2243,8 @@ void CharacterController::update(float duration, bool animationOnly) swimmingPitch += osg::clampBetween(targetSwimmingPitch - swimmingPitch, -maxSwimPitchDelta, maxSwimPitchDelta); mAnimation->setBodyPitchRadians(swimmingPitch); } - if (inwater && isPlayer && !isFirstPersonPlayer) + static const bool swimUpwardCorrection = Settings::Manager::getBool("swim upward correction", "Game"); + if (inwater && isPlayer && !isFirstPersonPlayer && swimUpwardCorrection) { static const float swimUpwardCoef = Settings::Manager::getFloat("swim upward coef", "Game"); static const float swimForwardCoef = sqrtf(1.0f - swimUpwardCoef * swimUpwardCoef); diff --git a/docs/source/reference/modding/settings/camera.rst b/docs/source/reference/modding/settings/camera.rst index 8d7078905..1025a2fbd 100644 --- a/docs/source/reference/modding/settings/camera.rst +++ b/docs/source/reference/modding/settings/camera.rst @@ -160,7 +160,7 @@ auto switch shoulder This setting makes difference only in third person mode if 'view over shoulder' is enabled. When player is close to an obstacle, automatically switches camera to the shoulder that is farther away from the obstacle. -This setting can only be configured by editing the settings configuration file. +This setting can be controlled in Advanced tab of the launcher. zoom out when move coef ----------------------- @@ -181,9 +181,10 @@ preview if stand still :Range: True/False :Default: False +Makes difference only in third person mode. If enabled then the character rotation is not synchonized with the camera rotation while the character doesn't move and not in combat mode. -This setting can only be configured by editing the settings configuration file. +This setting can be controlled in Advanced tab of the launcher. deferred preview rotation ------------------------- @@ -196,5 +197,5 @@ Makes difference only in third person mode. If enabled then the character smoothly rotates to the view direction after exiting preview or vanity mode. If disabled then the camera rotates rather than the character. -This setting can only be configured by editing the settings configuration file. +This setting can be controlled in Advanced tab of the launcher. diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index 5291fb0ed..46bd22e50 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -327,7 +327,18 @@ Affects side and diagonal movement. Enabling this setting makes movement more re If disabled then the whole character's body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding. -If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it also changes straight right and straight left movement. +If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it changes straight right and straight left movement as well. Also turns the whole body up or down when swimming according to the movement direction. + +This setting can be controlled in Advanced tab of the launcher. + +swim upward correction +---------------- + +:Type: boolean +:Range: True/False +:Default: False + +Makes player swim a bit upward from the line of sight. Applies only in third person mode. Intended to make simpler swimming without diving. This setting can be controlled in Advanced tab of the launcher. @@ -336,9 +347,10 @@ swim upward coef :Type: floating point :Range: -1.0 to 1.0 -:Default: 0.0 +:Default: 0.2 -Makes player swim a bit upward (or downward in case of negative value) from the line of sight. Intended to make simpler swimming without diving. Recommened range of values is from 0.0 to 0.2. +Regulates strength of the "swim upward correction" effect (if enabled). +Makes player swim a bit upward (or downward in case of negative value) from the line of sight. Recommened range of values is from 0.0 to 0.25. 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 65e72c177..ac5433f30 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -325,8 +325,11 @@ uncapped damage fatigue = false # Turn lower body to movement direction. 'true' makes diagonal movement more realistic. turn to movement direction = false -# Makes player swim a bit upward (or downward in case of negative value) from the line of sight. -swim upward coef = 0.0 +# Makes player swim a bit upward from the line of sight. +swim upward correction = false + +# Strength of the 'swim upward correction' effect (if enabled). +swim upward coef = 0.2 # Make the training skills proposed by a trainer based on its base attribute instead of its modified ones trainers training skills based on base skill = false diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 08ffe10ce..ca57e5dc8 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -116,6 +116,16 @@ + + + + <html><head/><body><p>Makes player swim a bit upward from the line of sight. Applies only in third person mode. Intended to make simpler swimming without diving.</p></body></html> + + + Swim upward correction + + + @@ -164,6 +174,16 @@ + + + + <html><head/><body><p>Enable navigator. When enabled background threads are started to build nav mesh for world geometry. Pathfinding system uses nav mesh to build paths. When disabled only pathgrid is used to build paths. Single-core CPU systems may have big performance impact on exiting interior location and moving across exterior world. May slightly affect performance on multi-core CPU systems. Multi-core CPU systems may have different latency for nav mesh update depending on other settings and system performance. Moving across external world, entering/exiting location produce nav mesh update. NPC and creatures may not be able to find path before nav mesh is built around them. Try to disable this if you want to have old fashioned AI which doesn’t know where to go when you stand behind that stone and casting a firebolt.</p></body></html> + + + Build nav mesh for world geometry + + + @@ -178,6 +198,52 @@ Visuals + + + + <html><head/><body><p>If this option is enabled, normal maps are automatically recognized and used if they are named appropriately +(see 'normal map pattern', e.g. for a base texture foo.dds, the normal map texture would have to be named foo_n.dds). +If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.nif or .osg file). Affects objects.</p></body></html> + + + Auto use object normal maps + + + + + + + <html><head/><body><p>If this option is enabled, specular maps are automatically recognized and used if they are named appropriately +(see 'specular map pattern', e.g. for a base texture foo.dds, +the specular map texture would have to be named foo_spec.dds). +If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file +(.osg file, not supported in .nif files). Affects objects.</p></body></html> + + + Auto use object specular maps + + + + + + + <html><head/><body><p>See 'auto use object normal maps'. Affects terrain.</p></body></html> + + + Auto use terrain normal maps + + + + + + + <html><head/><body><p>If a file with pattern 'terrain specular map pattern' exists, use that file as a 'diffuse specular' map. The texture must contain the layer colour in the RGB channel (as usual), and a specular multiplier in the alpha channel.</p></body></html> + + + Auto use terrain specular maps + + + @@ -191,6 +257,17 @@ Affected objects will use shaders. + + + + <html><head/><body><p>By default, the fog becomes thicker proportionally to your distance from the clipping plane set at the clipping distance, which causes distortion at the edges of the screen. +This setting makes the fog use the actual eye point distance (or so called Euclidean distance) to calculate the fog, which makes the fog look less artificial, especially if you have a wide FOV.</p></body></html> + + + Radial fog + + + @@ -246,22 +323,10 @@ Affected objects will use shaders. - - - - <html><head/><body><p>This setting controls third person view mode.</p><p>False: View is centered on the character's head. Crosshair is hidden. -True: In non-combat mode camera is positioned behind the character's shoulder. Crosshair is visible in third person mode as well. -</p></body></html> - - - View over the shoulder - - - - <html><head/><body><p>Affects side and diagonal movement. Enabling this setting makes movement more realistic.</p><p>If disabled then the whole character's body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding.</p><p>If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it also changes straight right and straight left movement.</p></body></html> + <html><head/><body><p>Affects side and diagonal movement. Enabling this setting makes movement more realistic.</p><p>If disabled then the whole character's body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding.</p><p>If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it changes straight right and straight left movement as well. Also turns the whole body up or down when swimming according to the movement direction.</p></body></html> Turn to movement direction @@ -328,6 +393,122 @@ but also increase the amount of rendered geometry and significantly reduce the f + + + Camera + + + + + + <html><head/><body><p>This setting controls third person view mode.</p><p>False: View is centered on the character's head. Crosshair is hidden. +True: In non-combat mode camera is positioned behind the character's shoulder. Crosshair is visible in third person mode as well. +</p></body></html> + + + View over the shoulder + + + + + + + + 20 + + + 0 + + + 0 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Default shoulder: + + + + + + + 0 + + + + Right + + + + + Left + + + + + + + + + + + <html><head/><body><p>When player is close to an obstacle, automatically switches camera to the shoulder that is farther away from the obstacle.</p></body></html> + + + Auto switch shoulder + + + + + + + + + + <html><head/><body><p>If enabled then the character rotation is not synchonized with the camera rotation while the character doesn't move and not in combat mode.</p></body></html> + + + Preview if stand still + + + + + + + <html><head/><body><p>If enabled then the character smoothly rotates to the view direction after exiting preview or vanity mode. If disabled then the camera rotates rather than the character.</p></body></html> + + + Deferred preview rotation + + + + + + + Qt::Vertical + + + + + Interface changes