summaryrefslogtreecommitdiffstats
path: root/source/Defines.h
diff options
context:
space:
mode:
authormgueydan <gueydan.mathieuÃ@gmail.com>2013-09-22 14:29:33 +0200
committermgueydan <gueydan.mathieuÃ@gmail.com>2013-09-22 14:29:33 +0200
commitac4cb65b8d8443c6bb7835934f4b74dc2bdb820d (patch)
tree6f869625bd6a4509e37231194d777fc4e9df7d5e /source/Defines.h
parentInside cMonster::getMobFamily() : replacing Polymorphism by Map, in order to remove redundancy (diff)
parentMerged branch 'Projectiles'. (diff)
downloadcuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.tar
cuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.tar.gz
cuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.tar.bz2
cuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.tar.lz
cuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.tar.xz
cuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.tar.zst
cuberite-ac4cb65b8d8443c6bb7835934f4b74dc2bdb820d.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)
{