Class Rotation

java.lang.Object
baritone.api.utils.Rotation

public class Rotation extends Object
Since:
9/25/2018
Author:
Brady
  • Constructor Details

    • Rotation

      public Rotation(float yaw, float pitch)
  • Method Details

    • getYaw

      public float getYaw()
      Returns:
      The yaw of this rotation
    • getPitch

      public float getPitch()
      Returns:
      The pitch of this rotation
    • add

      public Rotation add(Rotation other)
      Adds the yaw/pitch of the specified rotations to this rotation's yaw/pitch, and returns the result.
      Parameters:
      other - Another rotation
      Returns:
      The result from adding the other rotation to this rotation
    • subtract

      public Rotation subtract(Rotation other)
      Subtracts the yaw/pitch of the specified rotations from this rotation's yaw/pitch, and returns the result.
      Parameters:
      other - Another rotation
      Returns:
      The result from subtracting the other rotation from this rotation
    • clamp

      public Rotation clamp()
      Returns:
      A copy of this rotation with the pitch clamped
    • normalize

      public Rotation normalize()
      Returns:
      A copy of this rotation with the yaw normalized
    • normalizeAndClamp

      Returns:
      A copy of this rotation with the pitch clamped and the yaw normalized
    • withPitch

      public Rotation withPitch(float pitch)
    • isReallyCloseTo

      public boolean isReallyCloseTo(Rotation other)
      Is really close to
      Parameters:
      other - another rotation
      Returns:
      are they really close
    • yawIsReallyClose

      public boolean yawIsReallyClose(Rotation other)
    • clampPitch

      public static float clampPitch(float pitch)
      Clamps the specified pitch value between -90 and 90.
      Parameters:
      pitch - The input pitch
      Returns:
      The clamped pitch
    • normalizeYaw

      public static float normalizeYaw(float yaw)
      Normalizes the specified yaw value between -180 and 180.
      Parameters:
      yaw - The input yaw
      Returns:
      The normalized yaw
    • toString

      public String toString()
      Overrides:
      toString in class Object