diff options
| author | eray orçunus <erayorcunus@gmail.com> | 2019-07-15 15:11:40 +0300 |
|---|---|---|
| committer | eray orçunus <erayorcunus@gmail.com> | 2019-07-15 15:11:40 +0300 |
| commit | 2c138b2b77cf661d9f119061963a726fdcde56d0 (patch) | |
| tree | 1c8316f212304c911252b378b3b56368ba4ceaa9 /src/core/General.h | |
| parent | little change to aspect ratio defines (diff) | |
| download | re3-2c138b2b77cf661d9f119061963a726fdcde56d0.tar.gz | |
Phone, World, Ped
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; |
