summaryrefslogtreecommitdiffstats
path: root/source/Defines.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-07 22:06:30 +0200
committermadmaxoft <github@xoft.cz>2013-09-07 22:06:30 +0200
commitd31142811db9073b7b01b834ca3bf82f6bceb4a9 (patch)
tree9988b872e675a082253126b9ff292070e913b1cd /source/Defines.h
parentFixed a missing initialization in cMonster. (diff)
parentAdded a (disabled) block logging to projectile path-tracing. (diff)
downloadcuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.gz
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.bz2
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.lz
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.xz
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.tar.zst
cuberite-d31142811db9073b7b01b834ca3bf82f6bceb4a9.zip
Diffstat (limited to '')
-rw-r--r--source/Defines.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/source/Defines.h b/source/Defines.h
index 6bc1a18f6..6dd81137e 100644
--- a/source/Defines.h
+++ b/source/Defines.h
@@ -43,16 +43,24 @@ extern bool g_BlockIsSolid[256];
-/// Block face constants, used in PlayerDigging and PlayerBlockPlacement packets
-enum
+/// Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc
+enum eBlockFace
{
- BLOCK_FACE_NONE = -1, // Interacting with no block face - swinging the item in the air
- BLOCK_FACE_BOTTOM = 0, // Interacting with the bottom face of the block (YM)
- BLOCK_FACE_TOP = 1, // Interacting with the top face of the block (YP)
- BLOCK_FACE_NORTH = 2, // Interacting with the northern face of the block (ZP)
- BLOCK_FACE_SOUTH = 3, // Interacting with the southern face of the block (ZM)
- BLOCK_FACE_WEST = 4, // Interacting with the western face of the block (XP)
- BLOCK_FACE_EAST = 5, // Interacting with the eastern face of the block (XM)
+ BLOCK_FACE_NONE = -1, // Interacting with no block face - swinging the item in the air
+ BLOCK_FACE_XM = 5, // Interacting with the X- face of the block
+ BLOCK_FACE_XP = 4, // Interacting with the X+ face of the block
+ BLOCK_FACE_YM = 0, // Interacting with the Y- face of the block
+ BLOCK_FACE_YP = 1, // Interacting with the Y+ face of the block
+ BLOCK_FACE_ZM = 3, // Interacting with the Z- face of the block
+ BLOCK_FACE_ZP = 2, // Interacting with the Z+ face of the block
+
+ // Synonyms using the (deprecated) world directions:
+ BLOCK_FACE_BOTTOM = BLOCK_FACE_YM, // Interacting with the bottom face of the block
+ BLOCK_FACE_TOP = BLOCK_FACE_YP, // Interacting with the top face of the block
+ BLOCK_FACE_NORTH = BLOCK_FACE_ZP, // Interacting with the northern face of the block
+ BLOCK_FACE_SOUTH = BLOCK_FACE_ZM, // Interacting with the southern face of the block
+ BLOCK_FACE_WEST = BLOCK_FACE_XP, // Interacting with the western face of the block
+ BLOCK_FACE_EAST = BLOCK_FACE_XM, // Interacting with the eastern face of the block
} ;
@@ -345,8 +353,7 @@ inline void AddFaceDirection(int & a_BlockX, unsigned char & a_BlockY, int & a_B
-#include <math.h>
-#define PI 3.14159265358979323846264338327950288419716939937510582097494459072381640628620899862803482534211706798f
+#define PI 3.14159265358979323846264338327950288419716939937510582097494459072381640628620899862803482534211706798f
inline void EulerToVector(double a_Pan, double a_Pitch, double & a_X, double & a_Y, double & a_Z)
{