From 2c138b2b77cf661d9f119061963a726fdcde56d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Mon, 15 Jul 2019 15:11:40 +0300 Subject: Phone, World, Ped --- src/core/General.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/General.h') 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; -- cgit v1.2.3