244 switch (a_ClickAction)
397 (a_BlockType > -1) &&
503 default:
return false;
873 LOGWARNING(
"%s: Unknown face: %d", __FUNCTION__, a_BlockFace);
874 ASSERT(!
"AddFaceDirection(): Unknown face");
891 LOGWARNING(
"%s: Unknown inv face: %d", __FUNCTION__, a_BlockFace);
892 ASSERT(!
"AddFaceDirection(): Unknown face");
907 a_BlockY = Clamp<unsigned char>(
static_cast<unsigned char>(Y), 0,
cChunkDef::Height - 1);
914 inline void EulerToVector(
double a_Pan,
double a_Pitch,
double & a_X,
double & a_Y,
double & a_Z)
919 a_X = cos(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI);
920 a_Y = sin(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI);
921 a_Z = sin(a_Pitch / 180 * M_PI);
928 inline void VectorToEuler(
double a_X,
double a_Y,
double a_Z,
double & a_Pan,
double & a_Pitch)
930 double r = sqrt((a_X * a_X) + (a_Z * a_Z));
931 if (r < std::numeric_limits<double>::epsilon())
937 a_Pan = atan2(a_Z, a_X) * 180 / M_PI - 90;
940 a_Pitch = atan2(a_Y, r) * 180 / M_PI;
949 return (a_Val < 0.f) ? -1.f : 1.f;
958 return (a_Val <= 0.f) ? -1.f : 1.f;
965 template <
class T>
inline T
Diff(T a_Val1, T a_Val2)
967 return std::abs(a_Val1 - a_Val2);
1007 double Norm = fmod(a_Degrees + 180, 360);
1079 ||
IsAxe ( a_ItemID)
1081 ||
IsHoe ( a_ItemID)
eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace)
bool IsBlockMaterialVine(BLOCKTYPE a_BlockType)
bool IsBlockMaterialPlants(BLOCKTYPE a_BlockType)
AString BlockFaceToString(eBlockFace a_BlockFace)
Returns the textual representation of the BlockFace constant.
bool IsBlockWater(BLOCKTYPE a_BlockType)
bool IsBlockFence(BLOCKTYPE a_BlockType)
eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace)
Returns a blockface mirrored around the Y axis (doesn't change up / down).
bool IsSword(short a_ItemID)
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool IsHelmet(short a_ItemType)
bool IsTool(short a_ItemID)
bool IsHoe(short a_ItemID)
bool IsLeggings(short a_ItemType)
bool IsValidItem(int a_ItemType)
eBlockFace ReverseBlockFace(eBlockFace a_BlockFace)
bool IsBlockMaterialRock(BLOCKTYPE a_BlockType)
bool IsMinecart(short a_ItemType)
eClickAction
Individual actions sent in the WindowClick packet.
bool IsBlockLiquid(BLOCKTYPE a_BlockType)
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse=false)
const char * ClickActionToString(int a_ClickAction)
float GetSpecialSignf(float a_Val)
bool IsChestPlate(short a_ItemType)
Maximum disc itemtype number used.
bool IsBlockMaterialWood(BLOCKTYPE a_BlockType)
void LOGWARNING(const char *a_Format, fmt::ArgList a_ArgList)
bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType)
bool IsBlockRail(BLOCKTYPE a_BlockType)
bool IsHorseArmor(short a_ItemType)
bool IsValidBlock(int a_BlockType)
bool IsBlockMaterialCoral(BLOCKTYPE a_BlockType)
bool IsArmor(short a_ItemType)
double NormalizeAngleDegrees(const double a_Degrees)
Normalizes an angle in degrees to the [-180, +180) range:
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
void EulerToVector(double a_Pan, double a_Pitch, double &a_X, double &a_Y, double &a_Z)
bool IsAxe(short a_ItemID)
bool IsBlockTypeOfDirt(BLOCKTYPE a_BlockType)
Maximum BlockType number used.
bool IsShovel(short a_ItemID)
bool IsBlocksWool(BLOCKTYPE a_BlockType)
float GetSignf(float a_Val)
Maximum consecutive ItemType number used.
eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace)
Returns a blockface rotated around the Y axis counter-clockwise.
bool IsBlockIce(BLOCKTYPE a_BlockType)
bool IsBlockMaterialIron(BLOCKTYPE a_BlockType)
bool IsBlockMaterialLeaves(BLOCKTYPE a_BlockType)
bool IsBlockMaterialAnvil(BLOCKTYPE a_BlockType)
bool IsBlocksWeb(BLOCKTYPE a_BlockType)
#define UNREACHABLE(x)
Use to mark code that should be impossible to reach.
bool IsBoots(short a_ItemType)
bool IsPickaxe(short a_ItemID)
bool IsBlockMaterialGourd(BLOCKTYPE a_BlockType)
bool IsBlockLava(BLOCKTYPE a_BlockType)
T Diff(T a_Val1, T a_Val2)
std::vector< int > cSlotNums
List of slot numbers, used for inventory-painting.
void VectorToEuler(double a_X, double a_Y, double a_Z, double &a_Pan, double &a_Pitch)