CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.wrappers.Rotation Class Reference

A class to represent the yaw and pitch rotation in degrees. More...

Public Member Functions

 Rotation (float yaw, float pitch)
 Constructs a Rotation with a given yaw and pitch. More...
 
float getYaw ()
 Gets the yaw of this location, measured in degrees. More...
 
float getPitch ()
 Gets the pitch of this rotation, measured in degrees. More...
 
float getNormalizedYaw ()
 Normalizes the given yaw angle to a value between +/-180 degrees. More...
 
float getNormalizedPitch ()
 Normalizes the given pitch angle to a value between +/-90 degrees. More...
 
String toString ()
 
int hashCode ()
 
boolean equals (Object obj)
 

Detailed Description

A class to represent the yaw and pitch rotation in degrees.

Constructor & Destructor Documentation

◆ Rotation()

dev.jorel.commandapi.wrappers.Rotation.Rotation ( float  yaw,
float  pitch 
)

Constructs a Rotation with a given yaw and pitch.

Parameters
yawthe yaw of this rotation in degrees
pitchthe pitch of this rotation in degrees

Member Function Documentation

◆ getNormalizedPitch()

float dev.jorel.commandapi.wrappers.Rotation.getNormalizedPitch ( )

Normalizes the given pitch angle to a value between +/-90 degrees.

Returns
the normalized pitch in degrees

◆ getNormalizedYaw()

float dev.jorel.commandapi.wrappers.Rotation.getNormalizedYaw ( )

Normalizes the given yaw angle to a value between +/-180 degrees.

Returns
the normalized yaw in degrees

◆ getPitch()

float dev.jorel.commandapi.wrappers.Rotation.getPitch ( )

Gets the pitch of this rotation, measured in degrees.

Returns
this rotation's pitch

◆ getYaw()

float dev.jorel.commandapi.wrappers.Rotation.getYaw ( )

Gets the yaw of this location, measured in degrees.

Returns
this rotation's yaw

◆ toString()

String dev.jorel.commandapi.wrappers.Rotation.toString ( )
Returns
the Minecraft string value of this Rotation, in the form "@iliteral{code} <yaw> <pitch> @endiliteral "