From d4ea6912f5deb303f1ce75acf6c680d00244ea66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Wed, 3 Jul 2019 19:34:42 +0300 Subject: Even more CPed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: eray orçunus --- src/General.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/General.h') 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 { -- cgit v1.2.3