Skip to content

Axis

Package: com.hypixel.hytale.math

public enum Axis

Represents the three spatial axes (X, Y, Z). Each constant carries a unit direction vector and provides rotation and flip operations for both integer and double 3D vectors. Rotations are performed in 90-degree increments.

ConstantDirectionDescription
X(1, 0, 0)The X axis.
Y(0, 1, 0)The Y axis.
Z(0, 0, 1)The Z axis.
MethodReturn TypeDescription
getDirection()Vector3iReturns a clone of the unit direction vector for this axis.
rotate(@Nonnull Vector3i vector, int angle)voidRotates an integer vector around this axis by the given angle in degrees (must be a multiple of 90).
rotate(@Nonnull Vector3d vector, int angle)voidRotates a double vector around this axis by the given angle in degrees.
rotate(@Nonnull Vector3i vector)voidRotates an integer vector 90 degrees around this axis.
rotate(@Nonnull Vector3d vector)voidRotates a double vector 90 degrees around this axis.
flip(@Nonnull Vector3i vector)voidNegates the component of the integer vector along this axis.
flip(@Nonnull Vector3d vector)voidNegates the component of the double vector along this axis.
flipRotation(@Nonnull Vector3f rotation)voidFlips the rotation angle (yaw/pitch) corresponding to this axis.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.