Class Location

java.lang.Object
com.hypixel.hytale.math.vector.Location

public class Location extends Object
A location in a world, consisting of a position and rotation.
  • Constructor Details

    • Location

      public Location()
      Empty Constructor for a Location instance.
    • Location

      public Location(@Nonnull org.joml.Vector3i position)
      Constructor for a Location instance.
      Parameters:
      position - The position in the world.
    • Location

      public Location(@Nullable String world, @Nonnull org.joml.Vector3i position)
      Constructor for a Location instance.
      Parameters:
      world - The world the location is in, or null if unspecified.
      position - The position in the world.
    • Location

      public Location(@Nonnull org.joml.Vector3d position)
      Constructor for a Location instance.
      Parameters:
      position - The position in the world.
    • Location

      public Location(@Nullable String world, @Nonnull org.joml.Vector3d position)
      Constructor for a Location instance.
      Parameters:
      world - The world the location is in, or null if unspecified.
      position - The position in the world.
    • Location

      public Location(double x, double y, double z)
      Constructor for a Location instance.
      Parameters:
      x - The X coordinate of the position.
      y - The Y coordinate of the position.
      z - The Z coordinate of the position.
    • Location

      public Location(@Nullable String world, double x, double y, double z)
      Constructor for a Location instance.
      Parameters:
      world - The world the location is in, or null if unspecified.
      x - The X coordinate of the position.
      y - The Y coordinate of the position.
      z - The Z coordinate of the position.
    • Location

      public Location(double x, double y, double z, float pitch, float yaw, float roll)
      Constructor for a Location instance.
      Parameters:
      x - The X coordinate of the position.
      y - The Y coordinate of the position.
      z - The Z coordinate of the position.
      pitch - The pitch of the rotation.
      yaw - The yaw of the rotation.
      roll - The roll of the rotation.
    • Location

      public Location(@Nullable String world, double x, double y, double z, float pitch, float yaw, float roll)
      Constructor for a Location instance.
      Parameters:
      world - The world the location is in, or null if unspecified.
      x - The X coordinate of the position.
      y - The Y coordinate of the position.
      z - The Z coordinate of the position.
      pitch - The pitch of the rotation.
      yaw - The yaw of the rotation.
      roll - The roll of the rotation.
    • Location

      public Location(@Nonnull org.joml.Vector3d position, @Nonnull Rotation3f rotation)
      Constructor for a Location instance.
      Parameters:
      position - The position in the world.
      rotation - The rotation at the position.
    • Location

      public Location(@Nonnull Transform transform)
      Constructor for a Location instance.
      Parameters:
      transform - The transform containing the position and rotation.
    • Location

      public Location(@Nullable String world, @Nonnull Transform transform)
      Constructor for a Location instance.
      Parameters:
      world - The world the location is in, or null if unspecified.
      transform - The transform containing the position and rotation.
    • Location

      public Location(@Nullable String world, @Nonnull org.joml.Vector3d position, @Nonnull Rotation3f rotation)
      Default Constructor for a Location instance.
      Parameters:
      world - The world the location is in, or null if unspecified
      position - The position in the world.
      rotation - The rotation at the position.
  • Method Details

    • getWorld

      @Nullable public String getWorld()
      Returns:
      the world the location is in, or null if unspecified.
    • setWorld

      public void setWorld(@Nullable String world)
      Called to set the world of the location.
      Parameters:
      world - The world the location is in, or null if unspecified.
    • getPosition

      @Nonnull public org.joml.Vector3d getPosition()
      Returns:
      The position in the world.
    • setPosition

      public void setPosition(@Nonnull org.joml.Vector3d position)
      Called to set the position in the world.
      Parameters:
      position - The position in the world.
    • getRotation

      @Nonnull public Rotation3f getRotation()
      Returns:
      The rotation at the position.
    • setRotation

      public void setRotation(@Nonnull Rotation3f rotation)
      Called to set the rotation at the position.
      Parameters:
      rotation - The rotation at the position.
    • getDirection

      @Nonnull public org.joml.Vector3d getDirection()
      Returns:
      The direction of the rotation.
    • getAxisDirection

      @Nonnull public org.joml.Vector3i getAxisDirection()
      Returns:
      The direction of the rotation locked to an axis.
    • getAxisDirection

      @Nonnull public org.joml.Vector3i getAxisDirection(float pitch, float yaw)
      Parameters:
      pitch - The pitch of the rotation.
      yaw - The yaw of the rotation.
      Returns:
      the direction of the rotation locked to an axis.
    • getAxis

      @Nonnull public Axis getAxis()
      Returns:
      The axis of the rotation
    • toTransform

      @Nonnull public Transform toTransform()
      Returns:
      a Transform representation of this location.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object