Package de.slikey.effectlib.util
Class VectorUtils
java.lang.Object
de.slikey.effectlib.util.VectorUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleangleToXAxis(org.bukkit.util.Vector vector) static org.bukkit.util.VectorrotateAroundAxisX(org.bukkit.util.Vector vector, double angle) static org.bukkit.util.VectorrotateAroundAxisY(org.bukkit.util.Vector vector, double angle) static org.bukkit.util.VectorrotateAroundAxisZ(org.bukkit.util.Vector vector, double angle) static org.bukkit.util.VectorrotateVector(org.bukkit.util.Vector vector, double angleX, double angleY, double angleZ) static org.bukkit.util.VectorrotateVector(org.bukkit.util.Vector vector, float yawDegrees, float pitchDegrees) This handles non-unit vectors, with yaw and pitch instead of X,Y,Z angles.static org.bukkit.util.VectorrotateVector(org.bukkit.util.Vector vector, org.bukkit.Location location) Rotate a vector about a location using that location's direction
-
Method Details
-
rotateAroundAxisX
public static org.bukkit.util.Vector rotateAroundAxisX(org.bukkit.util.Vector vector, double angle) -
rotateAroundAxisY
public static org.bukkit.util.Vector rotateAroundAxisY(org.bukkit.util.Vector vector, double angle) -
rotateAroundAxisZ
public static org.bukkit.util.Vector rotateAroundAxisZ(org.bukkit.util.Vector vector, double angle) -
rotateVector
public static org.bukkit.util.Vector rotateVector(org.bukkit.util.Vector vector, double angleX, double angleY, double angleZ) -
rotateVector
public static org.bukkit.util.Vector rotateVector(org.bukkit.util.Vector vector, org.bukkit.Location location) Rotate a vector about a location using that location's direction- Parameters:
vector- vector to rotatelocation- location to get yaw and pitch from- Returns:
- rotated vector
-
rotateVector
public static org.bukkit.util.Vector rotateVector(org.bukkit.util.Vector vector, float yawDegrees, float pitchDegrees) This handles non-unit vectors, with yaw and pitch instead of X,Y,Z angles. Thanks to SexyToad!- Parameters:
vector- vector to rotateyawDegrees- yaw degreespitchDegrees- pitch degrees- Returns:
- rotated vector
-
angleToXAxis
public static double angleToXAxis(org.bukkit.util.Vector vector)
-