Package io.papermc.paper.math
Interface Rotations
Rotations is an immutable object that stores rotations
in degrees on each axis (X, Y, Z).
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(double x, double y, double z) Returns a new Rotations instance which is the result of adding the x, y, z components to this Rotationsstatic Rotations
ofDegrees
(double x, double y, double z) Creates a new Rotations instance holding the provided rotationsdefault Rotations
subtract
(double x, double y, double z) Returns a new Rotations instance which is the result of subtracting the x, y, z components from this RotationswithX
(double x) Returns a new Rotations instance which is the result of changing the X axis to the passed anglewithY
(double y) Returns a new Rotations instance which is the result of changing the Y axis to the passed anglewithZ
(double z) Returns a new Rotations instance which is the result of changing the Z axis to the passed angledouble
x()
Returns the angle on the X axis in degreesdouble
y()
Returns the angle on the Y axis in degreesdouble
z()
Returns the angle on the Z axis in degrees
-
Field Details
-
ZERO
Rotations instance with every axis set to 0
-
-
Method Details
-
ofDegrees
Creates a new Rotations instance holding the provided rotations- Parameters:
x
- the angle for the X axis in degreesy
- the angle for the Y axis in degreesz
- the angle for the Z axis in degrees- Returns:
- Rotations instance holding the provided rotations
-
x
double x()Returns the angle on the X axis in degrees- Returns:
- the angle in degrees
-
y
double y()Returns the angle on the Y axis in degrees- Returns:
- the angle in degrees
-
z
double z()Returns the angle on the Z axis in degrees- Returns:
- the angle in degrees
-
withX
Returns a new Rotations instance which is the result of changing the X axis to the passed angle- Parameters:
x
- the angle in degrees- Returns:
- the resultant Rotations
-
withY
Returns a new Rotations instance which is the result of changing the Y axis to the passed angle- Parameters:
y
- the angle in degrees- Returns:
- the resultant Rotations
-
withZ
Returns a new Rotations instance which is the result of changing the Z axis to the passed angle- Parameters:
z
- the angle in degrees- Returns:
- the resultant Rotations
-
add
Returns a new Rotations instance which is the result of adding the x, y, z components to this Rotations- Parameters:
x
- the angle to add to the X axis in degreesy
- the angle to add to the Y axis in degreesz
- the angle to add to the Z axis in degrees- Returns:
- the resultant Rotations
-
subtract
Returns a new Rotations instance which is the result of subtracting the x, y, z components from this Rotations- Parameters:
x
- the angle to subtract from the X axis in degreesy
- the angle to subtract from the Y axis in degreesz
- the angle to subtract from the Z axis in degrees- Returns:
- the resultant Rotations
-