Package me.c7dev.dexterity.api
Class DexRotation
java.lang.Object
me.c7dev.dexterity.api.DexRotation
Manages all rotation events of a
DexterityDisplay-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionManages 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 TypeMethodDescriptionvoidagain()Run the previous rotation againvoidClear the cached or pre-calculated data pertaining to the selection's rotationsvoidClears the queue of scheduled rotationsdoublegetPitch()Get the data used for the previous rotationdoublegetRoll()doublegetX()org.bukkit.util.VectorgetXAxis()doublegetY()doublegetYaw()org.bukkit.util.VectorgetYAxis()doublegetZ()org.bukkit.util.VectorgetZAxis()voidhighlightAxes(int seconds) Create marker points illustrating the direction of each axis.prepareRotation(RotationPlan plan, RotationTransaction transaction) Prepare a rotation that can be reused.voidRecalculate the axes of the selection based on the most commonDexBlockrotationvoidrotate(float yawDeg) Rotate around the yaw axis in degreesorg.joml.Quaterniondrotate(float yawDeg, float pitchDeg, float rollDeg) Rotate around the yaw, pitch, and roll directions in degreesvoidrotate(QueuedRotation rotation) Queue a rotationorg.joml.Quaterniondrotate(RotationPlan plan) Rotate by a specified plan with details about every axis and if it is asynchronous.voidrotate(org.joml.Quaterniond q1) Queue a rotationvoidrotate(org.joml.Quaterniond q1, boolean async) Queue a rotationvoidsetAxes(float yaw, float pitch, float roll) Recalculate the y, x, and z unit vectors by providing yaw, pitch, and roll in degreesvoidsetAxes(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 vectorsvoidSet 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 commonDexBlockrotation -
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 yawDeg) Rotate around the yaw axis in degrees- Parameters:
yawDeg-
-
rotate
public org.joml.Quaterniond rotate(float yawDeg, float pitchDeg, float rollDeg) 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-
-
clearQueue
public void clearQueue()Clears the queue of scheduled rotations -
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.
-