diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-07-03 18:34:42 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-07-04 03:59:29 +0200 |
commit | d4ea6912f5deb303f1ce75acf6c680d00244ea66 (patch) | |
tree | 7fd3df91850584be723a8394b6acb7a75ecb7cd6 /src/General.h | |
parent | Merge pull request #86 from erorcun/erorcun (diff) | |
download | re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.tar re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.tar.gz re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.tar.bz2 re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.tar.lz re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.tar.xz re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.tar.zst re3-d4ea6912f5deb303f1ce75acf6c680d00244ea66.zip |
Diffstat (limited to 'src/General.h')
-rw-r--r-- | src/General.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/General.h b/src/General.h index fd78edaa..d315d50b 100644 --- a/src/General.h +++ b/src/General.h @@ -42,13 +42,14 @@ public: static float LimitRadianAngle(float angle) { - if (angle < -25.0f) - angle = -25.0f; - - if (angle > 25.0f) - angle = 25.0f; + float result; - float result = angle; + if (angle < -25.0f) + result = -25.0f; + else if (angle > 25.0f) + result = 25.0f; + else + result = angle; while (result >= PI) { result -= 2 * PI; @@ -71,7 +72,7 @@ public: if (x > 0.0f) { if (y > 0.0f) - return 2 * PI - atan2(x / y, 1.0f); + return PI - atan2(x / y, 1.0f); else return -atan2(x / y, 1.0f); } else { |