diff --git a/apps/openmw/mwrender/animblendcontroller.cpp b/apps/openmw/mwrender/animblendcontroller.cpp index 61abfdd191..412c83d89a 100644 --- a/apps/openmw/mwrender/animblendcontroller.cpp +++ b/apps/openmw/mwrender/animblendcontroller.cpp @@ -4,10 +4,7 @@ #include -#define _USE_MATH_DEFINES - #include -#include #include #include @@ -25,17 +22,17 @@ namespace MWRender float sineOut(float x) { - return sin((x * M_PI) / 2); + return sin((x * osg::PIf) / 2); } float sineIn(float x) { - return 1 - cos((x * M_PI) / 2); + return 1 - cos((x * osg::PIf) / 2); } float sineInOut(float x) { - return -(cos(M_PI * x) - 1) / 2; + return -(cos(osg::PIf * x) - 1) / 2; } float cubicOut(float t) @@ -90,7 +87,7 @@ namespace MWRender { // Higher lambda = lower swing amplitude. 1 = 150% swing amplitude. // w is the frequency of oscillation in the easing func, controls the amount of overswing - constexpr float w = 1.5f * M_PI; // 4.71238 + const float w = 1.5f * osg::PIf; // 4.71238 return 1 - expf(-lambda * x) * cos(w * x); } diff --git a/components/sceneutil/animblendrules.cpp b/components/sceneutil/animblendrules.cpp index 130c285689..6e53d4bc5e 100644 --- a/components/sceneutil/animblendrules.cpp +++ b/components/sceneutil/animblendrules.cpp @@ -42,7 +42,6 @@ namespace SceneUtil } return std::make_pair(group, key); } - } using BlendRule = AnimBlendRules::BlendRule; @@ -168,5 +167,4 @@ namespace SceneUtil return std::nullopt; } - } diff --git a/docs/source/reference/modding/animation-blending.rst b/docs/source/reference/modding/animation-blending.rst index dec15e096d..1cc10b8863 100644 --- a/docs/source/reference/modding/animation-blending.rst +++ b/docs/source/reference/modding/animation-blending.rst @@ -20,8 +20,9 @@ In examples below ``.yaml`` config file will be used. You can provide ``.json`` Animation blending config file is a list of blending rules that look like this: -``` -blending_rules: +:: + + blending_rules: - from: "*" to: "*" easing: "sineOut" @@ -30,9 +31,8 @@ blending_rules: to: "idlesneak*" easing: "springOutWeak" duration: 0.4 -``` -See ``OpenMW\files\data\animations\animation-config.yaml`` for an example of such a file. +See `files/data/animations/animation-config.yaml `__ for an example of such a file. Every blending rule should include a set of following fields: @@ -85,6 +85,6 @@ List of possible easings Its hard to give an example of use cases for the latter 2 types of easing functions, they are there for developers to experiment. -The possible easings are largely ported from `here `__ and have similar names. Except for the ``springOut`` family, those are similar to ``elasticOut`` from `easings.net `__, with ``springOutWeak`` being almost identical to ``elasticOut``. +The possible easings are largely ported from `easings.net `__ and have similar names. Except for the ``springOut`` family, those are similar to ``elasticOut``, with ``springOutWeak`` being almost identical to ``elasticOut``. -Don't be afraid to experiment with different timing and easing functions! \ No newline at end of file +Don't be afraid to experiment with different timing and easing functions! diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index a602fa99fe..e4146f7322 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -543,7 +543,7 @@ Enabling this option disables this swaying by having the player character move i This setting can be controlled in the Settings tab of the launcher. smooth animation transitions ---------------------------------- +---------------------------- :Type: boolean :Range: True/False diff --git a/files/data/animations/animation-config.yaml b/files/data/animations/animation-config.yaml index 205e4d2145..1dd8c1da04 100644 --- a/files/data/animations/animation-config.yaml +++ b/files/data/animations/animation-config.yaml @@ -1,7 +1,6 @@ # This is the default OpenMW animation blending config file (global config) , will affect NPCs and creatures but not animated objects. # If you want to provide an animation blending config for your modded animations - DO NOT override the global config in your mod. # For details on how to edit and create your own blending rules, see https://openmw.readthedocs.io/en/latest/reference/modding/animation-blending.html -# Author: Maksim Eremenko (Max Yari) blending_rules: # General blending rule, any transition that will not be caught by the rules below - will use this rule