|
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Go to the documentation of this file.
16 constexpr
inline const int TPS = 20;
582 inline void EulerToVector(
double a_Pan,
double a_Pitch,
double & a_X,
double & a_Y,
double & a_Z)
587 a_X = cos(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI);
588 a_Y = sin(a_Pan / 180 * M_PI) * cos(a_Pitch / 180 * M_PI);
589 a_Z = sin(a_Pitch / 180 * M_PI);
596 inline void VectorToEuler(
double a_X,
double a_Y,
double a_Z,
double & a_Pan,
double & a_Pitch)
598 double r = sqrt((a_X * a_X) + (a_Z * a_Z));
599 if (r < std::numeric_limits<double>::epsilon())
605 a_Pan = atan2(a_Z, a_X) * 180 / M_PI - 90;
608 a_Pitch = atan2(a_Y, r) * 180 / M_PI;
616 inline T
Diff(T a_Val1, T a_Val2)
618 return std::abs(a_Val1 - a_Val2);
630 double Norm = fmod(a_Degrees + 180, 360);
646 bool IsAxe(
short a_ItemType);
648 bool IsSword(
short a_ItemType);
650 bool IsHoe(
short a_ItemType);
654 bool IsTool(
short a_ItemType);
662 bool IsBoots(
short a_ItemType);
666 bool IsArmor(
short a_ItemType);
void EulerToVector(double a_Pan, double a_Pitch, double &a_X, double &a_Y, double &a_Z)
eClickAction
Individual actions sent in the WindowClick packet.
bool IsChestPlate(short a_ItemType)
@ PawnFeetEquipmentBreaks
@ PawnOffHandEquipmentBreaks
eExplosionSource
The source of an explosion.
@ caLeftClickOutsideHoldNothing
eBlockFace ReverseBlockFace(eBlockFace a_BlockFace)
Returns a blockface opposite to the one specified.
eDamageType StringToDamageType(const AString &a_DamageString)
Translates a damage type string to damage type.
@ PawnHeadEquipmentBreaks
@ SKULL_ROTATION_NORTH_NORTH_WEST
@ SKULL_ROTATION_WEST_NORTH_WEST
@ PawnChestEquipmentBreaks
bool IsMinecart(short a_ItemType)
@ PawnLegsEquipmentBreaks
@ SKULL_ROTATION_NORTH_EAST
eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace)
Returns a blockface mirrored around the Y axis (doesn't change up / down).
@ MinecartSpawnerDelayResets
std::vector< int > cSlotNums
List of slot numbers, used for inventory-painting.
@ LeftOfUpsideDownDiagonal
AString DamageTypeToString(eDamageType a_DamageType)
Translates damage type constant to a string representation (built-in).
bool IsBoots(short a_ItemType)
bool IsTool(short a_ItemType)
AString BlockFaceToString(eBlockFace a_BlockFace)
Returns the textual representation of the BlockFace constant.
bool IsValidBlock(int a_BlockType)
Returns true if the specified block type is valid (known).
bool IsPickaxe(short a_ItemType)
eDimension StringToDimension(const AString &a_DimensionString)
Translates a dimension string to dimension enum.
@ SKULL_ROTATION_SOUTH_SOUTH_EAST
bool IsArmor(short a_ItemType)
@ MAX_EXPERIENCE_ORB_SIZE
bool IsVillagerFood(short a_ItemType)
@ SKULL_ROTATION_SOUTH_WEST
eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace)
Returns a blockface rotated around the Y axis counter-clockwise.
bool IsAxe(short a_ItemType)
AString DimensionToString(eDimension a_Dimension)
Translates a dimension enum to dimension string.
const char * ClickActionToString(int a_ClickAction)
Returns a textual representation of the click action.
@ EntityGetsMagicalCriticalHit
@ SKULL_ROTATION_SOUTH_EAST
eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace)
Returns a blockface rotated around the Y axis clockwise.
@ SKULL_ROTATION_NORTH_WEST
eDimension
Dimension of a world.
double NormalizeAngleDegrees(const double a_Degrees)
Normalizes an angle in degrees to the [-180, +180) range:
bool IsShovel(short a_ItemType)
@ ZombieVillagerCureFinishes
@ SKULL_ROTATION_SOUTH_SOUTH_WEST
T Diff(T a_Val1, T a_Val2)
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
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
@ DIG_STATUS_SWAP_ITEM_IN_HAND
void VectorToEuler(double a_X, double a_Y, double a_Z, double &a_Pan, double &a_Pitch)
@ PawnMainHandEquipmentBreaks
@ RightOfUpsideDownDiagonal
bool IsHelmet(short a_ItemType)
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).
constexpr const int TPS
Constant to calculate ticks from seconds "ticks per second".
bool IsHorseArmor(short a_ItemType)
@ SKULL_ROTATION_EAST_SOUTH_EAST
@ SKULL_ROTATION_WEST_SOUTH_WEST
@ caRightClickOutsideHoldNothing
@ SKULL_ROTATION_NORTH_NORTH_EAST
bool IsHoe(short a_ItemType)
bool IsSword(short a_ItemType)
@ SKULL_ROTATION_EAST_NORTH_EAST
bool IsLeggings(short a_ItemType)