summaryrefslogtreecommitdiffstats
path: root/src/core/General.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/General.h')
-rw-r--r--src/core/General.h16
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;