summaryrefslogtreecommitdiffstats
path: root/src/Defines.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-12-08 13:08:56 +0100
committermadmaxoft <github@xoft.cz>2013-12-08 13:08:56 +0100
commit6785bb7c165b1d5be87ebf414d877c774eeac708 (patch)
tree717963e13a3453a5daa4927006b327daf73ddd38 /src/Defines.h
parentMoved bindings-related to a Bindings subfolder. (diff)
downloadcuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.gz
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.bz2
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.lz
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.xz
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.tar.zst
cuberite-6785bb7c165b1d5be87ebf414d877c774eeac708.zip
Diffstat (limited to 'src/Defines.h')
-rw-r--r--src/Defines.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Defines.h b/src/Defines.h
index 5b27f4b3f..534802d55 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -416,6 +416,22 @@ inline float GetSpecialSignf( float a_Val )
// tolua_begin
+
+/// Normalizes an angle in degrees to the [-180, +180) range:
+inline double NormalizeAngleDegrees(const double a_Degrees)
+{
+ double Norm = fmod(a_Degrees + 180, 360);
+ if (Norm < 0)
+ {
+ Norm += 360;
+ }
+ return Norm - 180;
+}
+
+
+
+
+
namespace ItemCategory
{
inline bool IsPickaxe(short a_ItemID)