Package dev.jorel.commandapi.wrappers
Class Rotation
java.lang.Object
dev.jorel.commandapi.wrappers.Rotation
A class to represent the pitch and yaw rotation in degrees
-
Constructor Summary
ConstructorsConstructorDescriptionRotation(float pitch, float yaw) Constructs a Rotation with a given pitch and yaw -
Method Summary
Modifier and TypeMethodDescriptionfloatNormalizes 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.toString()Returns the Minecraft string value of this Rotation
-
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 degreesyaw- 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
Returns the Minecraft string value of this Rotation
-