diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-08 15:02:45 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-08 15:02:45 +0100 |
commit | 1d554677b49e7b2b2121b3fc4e3665a8be7bf710 (patch) | |
tree | d39d3790b018e0e8f04e81be1a2bc3870b3dae2a /src/Defines.h | |
parent | Fixed tabcompletion packet, fixes #356 (diff) | |
parent | Fixed normalizing large angles. (diff) | |
download | cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.gz cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.bz2 cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.lz cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.xz cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.tar.zst cuberite-1d554677b49e7b2b2121b3fc4e3665a8be7bf710.zip |
Diffstat (limited to 'src/Defines.h')
-rw-r--r-- | src/Defines.h | 16 |
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) |