16 constexpr
inline const int TPS = 20;
583 inline void EulerToVector(
double a_Pan,
double a_Pitch,
double & a_X,
double & a_Y,
double & a_Z)
588 a_X = cos(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI);
589 a_Y = sin(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI);
590 a_Z = sin(a_Pitch / 180 * M_PI);
597 inline void VectorToEuler(
double a_X,
double a_Y,
double a_Z,
double & a_Pan,
double & a_Pitch)
599 double r = sqrt((a_X * a_X) + (a_Z * a_Z));
600 if (r < std::numeric_limits<double>::epsilon())
606 a_Pan = atan2(a_Z, a_X) * 180 / M_PI - 90;
609 a_Pitch = atan2(a_Y, r) * 180 / M_PI;
617 inline T
Diff(T a_Val1, T a_Val2)
619 return std::abs(a_Val1 - a_Val2);
631 double Norm = fmod(a_Degrees + 180, 360);
647 bool IsAxe(
short a_ItemType);
649 bool IsSword(
short a_ItemType);
651 bool IsHoe(
short a_ItemType);
655 bool IsTool(
short a_ItemType);
663 bool IsBoots(
short a_ItemType);
667 bool IsArmor(
short a_ItemType);
T Diff(T a_Val1, T a_Val2)
@ RightOfUpsideDownDiagonal
@ LeftOfUpsideDownDiagonal
@ PawnOffHandEquipmentBreaks
@ ZombieVillagerCureFinishes
@ PawnFeetEquipmentBreaks
@ PawnMainHandEquipmentBreaks
@ PawnLegsEquipmentBreaks
@ MinecartSpawnerDelayResets
@ PawnHeadEquipmentBreaks
@ EntityGetsMagicalCriticalHit
@ PawnChestEquipmentBreaks
eDamageType StringToDamageType(const AString &a_DamageString)
Translates a damage type string to damage type.
@ SKULL_ROTATION_NORTH_EAST
@ SKULL_ROTATION_NORTH_NORTH_EAST
@ SKULL_ROTATION_NORTH_WEST
@ SKULL_ROTATION_WEST_NORTH_WEST
@ SKULL_ROTATION_SOUTH_SOUTH_EAST
@ SKULL_ROTATION_SOUTH_SOUTH_WEST
@ SKULL_ROTATION_EAST_SOUTH_EAST
@ SKULL_ROTATION_SOUTH_WEST
@ SKULL_ROTATION_WEST_SOUTH_WEST
@ SKULL_ROTATION_NORTH_NORTH_WEST
@ SKULL_ROTATION_SOUTH_EAST
@ SKULL_ROTATION_EAST_NORTH_EAST
bool IsValidBlock(int a_BlockType)
Returns true if the specified block type is valid (known).
eBlockFace ReverseBlockFace(eBlockFace a_BlockFace)
Returns a blockface opposite to the one specified.
@ DIG_STATUS_SWAP_ITEM_IN_HAND
eDimension
Dimension of a world.
double NormalizeAngleDegrees(const double a_Degrees)
Normalizes an angle in degrees to the [-180, +180) range:
void EulerToVector(double a_Pan, double a_Pitch, double &a_X, double &a_Y, double &a_Z)
AString DimensionToString(eDimension a_Dimension)
Translates a dimension enum to dimension string.
eExplosionSource
The source of an explosion.
eClickAction
Individual actions sent in the WindowClick packet.
@ caLeftClickOutsideHoldNothing
@ caRightClickOutsideHoldNothing
eDamageType
Damage type, used in the TakeDamageInfo structure and related functions.
bool IsValidItem(int a_ItemType)
Returns true if the specified item type is valid (known).
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace)
Returns a blockface rotated around the Y axis counter-clockwise.
constexpr const int TPS
Constant to calculate ticks from seconds "ticks per second".
@ MAX_EXPERIENCE_ORB_SIZE
eDimension StringToDimension(const AString &a_DimensionString)
Translates a dimension string to dimension enum.
AString DamageTypeToString(eDamageType a_DamageType)
Translates damage type constant to a string representation (built-in).
eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace)
Returns a blockface mirrored around the Y axis (doesn't change up / down).
AString BlockFaceToString(eBlockFace a_BlockFace)
Returns the textual representation of the BlockFace constant.
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)
const char * ClickActionToString(int a_ClickAction)
Returns a textual representation of the click action.
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse=false)
Modifies the specified coords so that they point to the block adjacent to the one specified through i...
eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace)
Returns a blockface rotated around the Y axis clockwise.
bool IsMinecart(short a_ItemType)
bool IsHoe(short a_ItemType)
bool IsHelmet(short a_ItemType)
bool IsPickaxe(short a_ItemType)
bool IsTool(short a_ItemType)
bool IsAxe(short a_ItemType)
bool IsVillagerFood(short a_ItemType)
bool IsLeggings(short a_ItemType)
bool IsChestPlate(short a_ItemType)
bool IsArmor(short a_ItemType)
bool IsBoots(short a_ItemType)
bool IsShovel(short a_ItemType)
bool IsHorseArmor(short a_ItemType)
bool IsSword(short a_ItemType)