summaryrefslogtreecommitdiffstats
path: root/src/Defines.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-10-23 14:59:42 +0200
committerHowaner <franzi.moos@googlemail.com>2014-10-23 14:59:42 +0200
commit72bb299a4a4f74840c3b368c6669ddc3d32006ee (patch)
tree748fee756010b1f36aa95162f762e21ee0d19c0a /src/Defines.h
parentMerge branch 'master' into ChunkLoader (diff)
parentFixed a crash in redstone simulator. (diff)
downloadcuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.gz
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.bz2
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.lz
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.xz
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.zst
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.zip
Diffstat (limited to '')
-rw-r--r--src/Defines.h12
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;
}