Package dev.jorel.commandapi.wrappers
Class Rotation
java.lang.Object
dev.jorel.commandapi.wrappers.Rotation
A class to represent the yaw and pitch rotation in degrees
-
Constructor Summary
ConstructorsConstructorDescriptionRotation(float yaw, float pitch) Constructs a Rotation with a given yaw and pitch -
Method Summary
Modifier and TypeMethodDescriptionbooleanfloatNormalizes the given pitch angle to a value between +/-90 degrees.floatNormalizes the given yaw angle to a value between +/-180 degrees.floatgetPitch()Gets the pitch of this rotation, measured in degrees.floatgetYaw()Gets the yaw of this location, measured in degrees.inthashCode()toString()
-
Constructor Details
-
Rotation
public Rotation(float yaw, float pitch) Constructs a Rotation with a given yaw and pitch- Parameters:
yaw- the yaw of this rotation in degreespitch- the pitch of this rotation in degrees
-
-
Method Details
-
getYaw
public float getYaw()Gets the yaw of this location, measured in degrees.- Returns:
- this rotation's yaw
-
getPitch
public float getPitch()Gets the pitch of this rotation, measured in degrees.- Returns:
- this rotation's pitch
-
getNormalizedYaw
public float getNormalizedYaw()Normalizes the given yaw angle to a value between +/-180 degrees.- Returns:
- the normalized yaw in degrees
-
getNormalizedPitch
public float getNormalizedPitch()Normalizes the given pitch angle to a value between +/-90 degrees.- Returns:
- the normalized pitch in degrees
-
toString
-
hashCode
public int hashCode() -
equals
-