diff options
author | Mattes D <github@xoft.cz> | 2014-10-23 08:29:31 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-23 08:29:31 +0200 |
commit | 4bfd2c9707f2c8484587f061393e8f9346d60fef (patch) | |
tree | 4b7bea204c0ddd18bb4f95357f9eb77590bc2e8d /src/Defines.h | |
parent | ComposableGenerator: Removed nullptr initializers. (diff) | |
parent | En masse NULL -> nullptr replace (diff) | |
download | cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.gz cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.bz2 cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.lz cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.xz cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.zst cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.zip |
Diffstat (limited to 'src/Defines.h')
-rw-r--r-- | src/Defines.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Defines.h b/src/Defines.h index f1ff911e7..c2f46c241 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -477,16 +477,16 @@ inline void AddFaceDirection(int & a_BlockX, unsigned char & a_BlockY, int & a_B -#define PI 3.14159265358979323846264338327950288419716939937510582097494459072381640628620899862803482534211706798f + inline void EulerToVector(double a_Pan, double a_Pitch, double & a_X, double & a_Y, double & a_Z) { // a_X = sinf ( a_Pan / 180 * PI) * cosf ( a_Pitch / 180 * PI); // a_Y = -sinf ( a_Pitch / 180 * PI); // a_Z = -cosf ( a_Pan / 180 * PI) * cosf ( a_Pitch / 180 * PI); - a_X = cos(a_Pan / 180 * PI) * cos(a_Pitch / 180 * PI); - a_Y = sin(a_Pan / 180 * PI) * cos(a_Pitch / 180 * PI); - a_Z = sin(a_Pitch / 180 * PI); + a_X = cos(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI); + a_Y = sin(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI); + a_Z = sin(a_Pitch / 180 * M_PI); } @@ -502,10 +502,10 @@ inline void VectorToEuler(double a_X, double a_Y, double a_Z, double & a_Pan, do } else { - a_Pan = atan2(a_Z, a_X) * 180 / PI - 90; + a_Pan = atan2(a_Z, a_X) * 180 / M_PI - 90; } - a_Pitch = atan2(a_Y, r) * 180 / PI; + a_Pitch = atan2(a_Y, r) * 180 / M_PI; } |