Enum Class Axis

java.lang.Object
java.lang.Enum<Axis>
com.hypixel.hytale.math.Axis
All Implemented Interfaces:
Serializable, Comparable<Axis>, Constable

public enum Axis extends Enum<Axis>
An enum that represents the three primary axes in 3D space: X, Y, and Z.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The X axis.
    The Y axis.
    The Z axis.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flip(org.joml.Vector3d vector)
    Flips the x, y, or z component of the given vector that corresponds to this Axis.
    void
    flip(org.joml.Vector3i vector)
    Flips the x, y, or z component of the given vector that corresponds to this Axis.
    void
    Flips the x, y, or z component of the rotation vector that corresponds to this Axis.
    org.joml.Vector3ic
     
    void
    rotate(org.joml.Vector3d vector)
    Rotates the given vector 90 degrees around this axis.
    void
    rotate(org.joml.Vector3d vector, int angle)
    Rotates the given vector around this axis by the specified angle in degrees.
    void
    rotate(org.joml.Vector3i vector)
    Rotates the given vector 90 degrees around this axis.
    void
    rotate(org.joml.Vector3i vector, int angle)
    Rotates the given vector around this axis by the specified angle in degrees.
    static Axis
    Returns the enum constant of this class with the specified name.
    static Axis[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • X

      public static final Axis X
      The X axis.
    • Y

      public static final Axis Y
      The Y axis.
    • Z

      public static final Axis Z
      The Z axis.
  • Method Details

    • values

      public static Axis[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Axis valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDirection

      @Nonnull public org.joml.Vector3ic getDirection()
      Returns:
      the direction vector representing this axis.
    • rotate

      public void rotate(@Nonnull org.joml.Vector3i vector, int angle)
      Rotates the given vector around this axis by the specified angle in degrees.
      Parameters:
      vector - The vector to rotate.
      angle - The angle in degrees to rotate the vector.
    • rotate

      public void rotate(@Nonnull org.joml.Vector3d vector, int angle)
      Rotates the given vector around this axis by the specified angle in degrees.
      Parameters:
      vector - The vector to rotate.
      angle - The angle in degrees to rotate the vector.
    • rotate

      public void rotate(@Nonnull org.joml.Vector3i vector)
      Rotates the given vector 90 degrees around this axis.
      Parameters:
      vector - The vector to rotate.
    • rotate

      public void rotate(@Nonnull org.joml.Vector3d vector)
      Rotates the given vector 90 degrees around this axis.
      Parameters:
      vector - The vector to rotate.
    • flip

      public void flip(@Nonnull org.joml.Vector3i vector)
      Flips the x, y, or z component of the given vector that corresponds to this Axis. This has the effect of mirroring
      Parameters:
      vector - The vector to flip.
    • flip

      public void flip(@Nonnull org.joml.Vector3d vector)
      Flips the x, y, or z component of the given vector that corresponds to this Axis. This has the effect of mirroring
      Parameters:
      vector - The vector to flip.
    • flipRotation

      public void flipRotation(@Nonnull Rotation3f rotation)
      Flips the x, y, or z component of the rotation vector that corresponds to this Axis. This has the effect of mirroring the rotation across the plane made by the remaining two axes.
      Parameters:
      rotation - The rotation vector to flip whose x-value represents pitch and y-value represents yaw (in radians).