diff options
author | aap <aap@papnet.eu> | 2019-07-16 18:31:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-16 18:31:29 +0200 |
commit | 3fee2bef9888e188b07e011067652388a5585f96 (patch) | |
tree | b80e8bc8569fbdda5929123a8f47d0c62aea0ab0 /src/core/General.h | |
parent | Merge pull request #136 from Nick007J/master (diff) | |
parent | Merge branch 'master' into erorcun (diff) | |
download | re3-3fee2bef9888e188b07e011067652388a5585f96.tar re3-3fee2bef9888e188b07e011067652388a5585f96.tar.gz re3-3fee2bef9888e188b07e011067652388a5585f96.tar.bz2 re3-3fee2bef9888e188b07e011067652388a5585f96.tar.lz re3-3fee2bef9888e188b07e011067652388a5585f96.tar.xz re3-3fee2bef9888e188b07e011067652388a5585f96.tar.zst re3-3fee2bef9888e188b07e011067652388a5585f96.zip |
Diffstat (limited to 'src/core/General.h')
-rw-r--r-- | src/core/General.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/General.h b/src/core/General.h index 64613478..7c0c9562 100644 --- a/src/core/General.h +++ b/src/core/General.h @@ -36,6 +36,22 @@ public: } } + static float LimitAngle(float angle) + { + float result = angle; + + while (result >= 180.0f) { + result -= 2 * 180.0f; + } + + while (result < -180.0f) { + result += 2 * 180.0f; + } + + return result; + } + + static float LimitRadianAngle(float angle) { float result; |