diff options
author | worktycho <work.tycho@gmail.com> | 2014-03-14 15:34:29 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-03-14 15:34:29 +0100 |
commit | b8cffe569f8bf6e3379f1c45d9e32a986efac25e (patch) | |
tree | 4688783dbca9b7a6f0ef662926d07e4c5edc25d6 /src/Defines.h | |
parent | cPlugin:BindConsoleCommand can be called statically. (diff) | |
parent | Merge branch 'master' into warnings (diff) | |
download | cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.gz cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.bz2 cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.lz cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.xz cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.tar.zst cuberite-b8cffe569f8bf6e3379f1c45d9e32a986efac25e.zip |
Diffstat (limited to 'src/Defines.h')
-rw-r--r-- | src/Defines.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Defines.h b/src/Defines.h index d2fcce576..3b7654265 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -2,6 +2,7 @@ #pragma once #include "ChatColor.h" +#include <limits> @@ -489,7 +490,7 @@ inline void EulerToVector(double a_Pan, double a_Pitch, double & a_X, double & a inline void VectorToEuler(double a_X, double a_Y, double a_Z, double & a_Pan, double & a_Pitch) { - if (a_X != 0) + if (fabs(a_X) < std::numeric_limits<double>::epsilon()) { a_Pan = atan2(a_Z, a_X) * 180 / PI - 90; } |