Class VectorUtils
java.lang.Object
dev.esophose.playerparticles.util.VectorUtils
public final class VectorUtils
extends java.lang.Object
- 
Method SummaryModifier and Type Method Description static doubleangleToXAxis(org.bukkit.util.Vector vector)Gets the angle toward the X axisstatic org.bukkit.util.VectorrotateAroundAxisX(org.bukkit.util.Vector v, double angle)Rotates a vector around the X axis at an anglestatic org.bukkit.util.VectorrotateAroundAxisY(org.bukkit.util.Vector v, double angle)Rotates a vector around the Y axis at an anglestatic org.bukkit.util.VectorrotateAroundAxisZ(org.bukkit.util.Vector v, double angle)Rotates a vector around the Z axis at an anglestatic org.bukkit.util.VectorrotateVector(org.bukkit.util.Vector v, double angleX, double angleY, double angleZ)Rotates a vector around the X, Y, and Z axesstatic org.bukkit.util.VectorrotateVector(org.bukkit.util.Vector v, 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 v, org.bukkit.Location location)Rotate a vector about a location using that location's direction
- 
Method Details- 
rotateAroundAxisXpublic static org.bukkit.util.Vector rotateAroundAxisX(org.bukkit.util.Vector v, double angle)Rotates a vector around the X axis at an angle- Parameters:
- v- Starting vector
- angle- How much to rotate
- Returns:
- The starting vector rotated
 
- 
rotateAroundAxisYpublic static org.bukkit.util.Vector rotateAroundAxisY(org.bukkit.util.Vector v, double angle)Rotates a vector around the Y axis at an angle- Parameters:
- v- Starting vector
- angle- How much to rotate
- Returns:
- The starting vector rotated
 
- 
rotateAroundAxisZpublic static org.bukkit.util.Vector rotateAroundAxisZ(org.bukkit.util.Vector v, double angle)Rotates a vector around the Z axis at an angle- Parameters:
- v- Starting vector
- angle- How much to rotate
- Returns:
- The starting vector rotated
 
- 
rotateVectorpublic static org.bukkit.util.Vector rotateVector(org.bukkit.util.Vector v, double angleX, double angleY, double angleZ)Rotates a vector around the X, Y, and Z axes- Parameters:
- v- The starting vector
- angleX- The change angle on X
- angleY- The change angle on Y
- angleZ- The change angle on Z
- Returns:
- The starting vector rotated
 
- 
rotateVectorpublic static org.bukkit.util.Vector rotateVector(org.bukkit.util.Vector v, org.bukkit.Location location)Rotate a vector about a location using that location's direction- Parameters:
- v- The starting vector
- location- The location to rotate around
- Returns:
- The starting vector rotated
 
- 
rotateVectorpublic static org.bukkit.util.Vector rotateVector(org.bukkit.util.Vector v, float yawDegrees, float pitchDegrees)This handles non-unit vectors, with yaw and pitch instead of X,Y,Z angles. Thanks to SexyToad!- Parameters:
- v- The starting vector
- yawDegrees- The yaw offset in degrees
- pitchDegrees- The pitch offset in degrees
- Returns:
- The starting vector rotated
 
- 
angleToXAxispublic static double angleToXAxis(org.bukkit.util.Vector vector)Gets the angle toward the X axis- Parameters:
- vector- The vector to check
- Returns:
- The angle toward the X axis
 
 
-