Class Rotation

java.lang.Object
dev.jorel.commandapi.wrappers.Rotation

public class Rotation extends Object
A class to represent the pitch and yaw rotation in degrees
  • Constructor Summary

    Constructors
    Constructor
    Description
    Rotation(float pitch, float yaw)
    Constructs a Rotation with a given pitch and yaw
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Normalizes the given pitch angle to a value between +/-90 degrees.
    float
    Normalizes the given yaw angle to a value between +/-180 degrees.
    float
    Gets the pitch of this rotation, measured in degrees.
    float
    Gets the yaw of this location, measured in degrees.
    Returns the Minecraft string value of this Rotation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Rotation

      public Rotation(float pitch, float yaw)
      Constructs a Rotation with a given pitch and yaw
      Parameters:
      pitch - the pitch of this rotation in degrees
      yaw - the yaw of this rotation in degrees
  • Method Details

    • getPitch

      public float getPitch()
      Gets the pitch of this rotation, measured in degrees.
      Returns:
      this rotation's pitch
    • getYaw

      public float getYaw()
      Gets the yaw of this location, measured in degrees.
      Returns:
      this rotation's yaw
    • getNormalizedPitch

      public float getNormalizedPitch()
      Normalizes the given pitch angle to a value between +/-90 degrees.
      Returns:
      the normalized pitch in degrees
    • getNormalizedYaw

      public float getNormalizedYaw()
      Normalizes the given yaw angle to a value between +/-180 degrees.
      Returns:
      the normalized yaw in degrees
    • toString

      public String toString()
      Returns the Minecraft string value of this Rotation
      Overrides:
      toString in class Object
      Returns:
      the Minecraft string value of this Rotation