Package me.c7dev.dexterity.api
Class DexRotation
java.lang.Object
me.c7dev.dexterity.api.DexRotation
Manages all rotation events of a
DexterityDisplay
-
Field Summary
-
Constructor Summary
ConstructorDescriptionManages all rotations and data used for rotations for a specific DexterityDisplayDexRotation
(DexterityDisplay d, double yaw, double pitch, double roll) Manages all rotations and data used for rotations for a specific DexterityDisplayDexRotation
(DexterityDisplay d, org.bukkit.util.Vector x, org.bukkit.util.Vector y, org.bukkit.util.Vector z) Manages all rotations and data used for rotations for a specific DexterityDisplay -
Method Summary
Modifier and TypeMethodDescriptionvoid
again()
Run the previous rotation againvoid
Clear the cached or pre-calculated data pertaining to the selection's rotationsdouble
getPitch()
Get the data used for the previous rotationdouble
getRoll()
double
getX()
org.bukkit.util.Vector
getXAxis()
double
getY()
double
getYaw()
org.bukkit.util.Vector
getYAxis()
double
getZ()
org.bukkit.util.Vector
getZAxis()
void
highlightAxes
(int seconds) Create marker points illustrating the direction of each axis.prepareRotation
(RotationPlan plan, RotationTransaction transaction) Prepare a rotation that can be reused.void
Recalculate the axes of the selection based on the most commonDexBlock
rotationvoid
rotate
(float yaw_deg) Rotate around the yaw axis in degreesorg.joml.Quaterniond
rotate
(float yaw_deg, float pitch_deg, float roll_deg) Rotate around the yaw, pitch, and roll directions in degreesvoid
rotate
(QueuedRotation rotation) Queue a rotationorg.joml.Quaterniond
rotate
(RotationPlan plan) Rotate by a specified plan with details about every axis and if it is asynchronous.void
rotate
(org.joml.Quaterniond q1) Queue a rotationvoid
rotate
(org.joml.Quaterniond q1, boolean async) Queue a rotationvoid
setAxes
(float yaw, float pitch, float roll) Recalculate the y, x, and z unit vectors by providing yaw, pitch, and roll in degreesvoid
setAxes
(org.bukkit.util.Vector x, org.bukkit.util.Vector y, org.bukkit.util.Vector z) Overwrite the axes of the selection, providing new orthogonal unit vectorsvoid
Set a transaction to be used to be able to undo a rotation
-
Field Details
-
cutoff
public static final double cutoff- See Also:
-
-
Constructor Details
-
DexRotation
Manages all rotations and data used for rotations for a specific DexterityDisplay- Parameters:
d
-
-
DexRotation
public DexRotation(DexterityDisplay d, org.bukkit.util.Vector x, org.bukkit.util.Vector y, org.bukkit.util.Vector z) Manages all rotations and data used for rotations for a specific DexterityDisplay- Parameters:
d
-x
- The orthogonal unit vector for the selection's x directiony
- The orthogonal unit vector for the selection's y directionz
- The orthogonal unit vector for the selection's z direction
-
DexRotation
Manages all rotations and data used for rotations for a specific DexterityDisplay- Parameters:
d
-yaw
- The selection's yaw in degreespitch
- The selection's pitch in degreesroll
- The selection's roll in degrees
-
-
Method Details
-
refreshAxis
public void refreshAxis()Recalculate the axes of the selection based on the most commonDexBlock
rotation -
getXAxis
public org.bukkit.util.Vector getXAxis() -
getYAxis
public org.bukkit.util.Vector getYAxis() -
getZAxis
public org.bukkit.util.Vector getZAxis() -
setTransaction
Set a transaction to be used to be able to undo a rotation- Parameters:
t2
-
-
clearCached
public void clearCached()Clear the cached or pre-calculated data pertaining to the selection's rotations -
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
getYaw
public double getYaw() -
getPitch
public double getPitch() -
getRoll
public double getRoll() -
setAxes
public void setAxes(org.bukkit.util.Vector x, org.bukkit.util.Vector y, org.bukkit.util.Vector z) Overwrite the axes of the selection, providing new orthogonal unit vectors- Parameters:
x
-y
-z
-
-
setAxes
public void setAxes(float yaw, float pitch, float roll) Recalculate the y, x, and z unit vectors by providing yaw, pitch, and roll in degrees- Parameters:
yaw
-pitch
-roll
-
-
rotate
public void rotate(float yaw_deg) Rotate around the yaw axis in degrees- Parameters:
yaw_deg
-
-
rotate
public org.joml.Quaterniond rotate(float yaw_deg, float pitch_deg, float roll_deg) Rotate around the yaw, pitch, and roll directions in degrees -
rotate
Rotate by a specified plan with details about every axis and if it is asynchronous.- Parameters:
plan
-- Returns:
- Unmodifiable quaternion for the queued rotation
-
prepareRotation
Prepare a rotation that can be reused. Note that using this will not update the internal yaw, pitch, roll, x, y, or z, so refreshAxis() will be needed afterwards.- Parameters:
plan
-transaction
-- Returns:
-
again
public void again()Run the previous rotation again -
rotate
public void rotate(org.joml.Quaterniond q1) Queue a rotation- Parameters:
q1
-
-
rotate
public void rotate(org.joml.Quaterniond q1, boolean async) Queue a rotation- Parameters:
q1
-async
-
-
rotate
Queue a rotation- Parameters:
rotation
-
-
getPreviousRotation
Get the data used for the previous rotation- Returns:
- Unmodifiable object containing quaternion, transaction, and async boolean
-
highlightAxes
public void highlightAxes(int seconds) Create marker points illustrating the direction of each axis. X: Red, Y: Lime, Z: Blue- Parameters:
seconds
- The number of seconds that the marker points should last.
-