Package ch.njol.util

Class VectorMath

java.lang.Object
ch.njol.util.VectorMath

public class VectorMath extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
    static final double
     
    static final double
     
    static final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    copyVector(org.bukkit.util.Vector vector1, org.bukkit.util.Vector vector2)
    Copies vector components of vector2 into vector1.
    static org.bukkit.util.Vector
    fromCylindricalCoordinates(double radius, double phi, double height)
     
    static float
    fromNotchPitch(float notchPitch)
     
    static float
    fromNotchYaw(float notchYaw)
     
    static float
    fromSkriptPitch(float pitch)
     
    static float
    fromSkriptYaw(float yaw)
     
    static org.bukkit.util.Vector
    fromSphericalCoordinates(double radius, double theta, double phi)
     
    static org.bukkit.util.Vector
    fromYawAndPitch(float yaw, float pitch)
     
    static float
    getPitch(org.bukkit.util.Vector vector)
     
    static float
    getYaw(org.bukkit.util.Vector vector)
     
    static boolean
    isZero(org.bukkit.util.Vector vector)
    Check whether or not each component of this vector is equal to 0.
    static float
    notchPitch(float pitch)
     
    static float
    notchYaw(float yaw)
     
    static org.bukkit.util.Vector
    rot(org.bukkit.util.Vector vector, org.bukkit.util.Vector axis, double angle)
     
    static org.bukkit.util.Vector
    rotX(org.bukkit.util.Vector vector, double angle)
     
    static org.bukkit.util.Vector
    rotY(org.bukkit.util.Vector vector, double angle)
     
    static org.bukkit.util.Vector
    rotZ(org.bukkit.util.Vector vector, double angle)
     
    static org.bukkit.util.Vector
    setPitch(org.bukkit.util.Vector vector, float pitch)
     
    static org.bukkit.util.Vector
    setYaw(org.bukkit.util.Vector vector, float yaw)
     
    static float
    skriptPitch(float pitch)
     
    static float
    skriptYaw(float yaw)
     
    static float
    wrapAngleDeg(float angle)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • VectorMath

      public VectorMath()
  • Method Details

    • fromSphericalCoordinates

      public static org.bukkit.util.Vector fromSphericalCoordinates(double radius, double theta, double phi)
    • fromCylindricalCoordinates

      public static org.bukkit.util.Vector fromCylindricalCoordinates(double radius, double phi, double height)
    • fromYawAndPitch

      public static org.bukkit.util.Vector fromYawAndPitch(float yaw, float pitch)
    • getYaw

      public static float getYaw(org.bukkit.util.Vector vector)
    • getPitch

      public static float getPitch(org.bukkit.util.Vector vector)
    • setYaw

      public static org.bukkit.util.Vector setYaw(org.bukkit.util.Vector vector, float yaw)
    • setPitch

      public static org.bukkit.util.Vector setPitch(org.bukkit.util.Vector vector, float pitch)
    • rotX

      public static org.bukkit.util.Vector rotX(org.bukkit.util.Vector vector, double angle)
    • rotY

      public static org.bukkit.util.Vector rotY(org.bukkit.util.Vector vector, double angle)
    • rotZ

      public static org.bukkit.util.Vector rotZ(org.bukkit.util.Vector vector, double angle)
    • rot

      public static org.bukkit.util.Vector rot(org.bukkit.util.Vector vector, org.bukkit.util.Vector axis, double angle)
    • notchYaw

      public static float notchYaw(float yaw)
    • notchPitch

      public static float notchPitch(float pitch)
    • fromNotchYaw

      public static float fromNotchYaw(float notchYaw)
    • fromNotchPitch

      public static float fromNotchPitch(float notchPitch)
    • skriptYaw

      public static float skriptYaw(float yaw)
    • skriptPitch

      public static float skriptPitch(float pitch)
    • fromSkriptYaw

      public static float fromSkriptYaw(float yaw)
    • fromSkriptPitch

      public static float fromSkriptPitch(float pitch)
    • wrapAngleDeg

      public static float wrapAngleDeg(float angle)
    • copyVector

      public static void copyVector(org.bukkit.util.Vector vector1, org.bukkit.util.Vector vector2)
      Copies vector components of vector2 into vector1.
    • isZero

      public static boolean isZero(org.bukkit.util.Vector vector)
      Check whether or not each component of this vector is equal to 0.
      Replaces Vector#isZero() since that method was added in spigot 1.19.3
      Returns:
      true if equal to zero, false if at least one component is non-zero