Package ch.njol.util

Class VectorMath

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

public class VectorMath extends Object
  • Field Details

  • Constructor Details

    • VectorMath

      public VectorMath()
  • Method Details

    • fromSphericalCoordinates

      public static Vector fromSphericalCoordinates(double radius, double theta, double phi)
    • fromCylindricalCoordinates

      public static Vector fromCylindricalCoordinates(double radius, double phi, double height)
    • fromYawAndPitch

      public static Vector fromYawAndPitch(float yaw, float pitch)
    • getYaw

      public static float getYaw(Vector vector)
    • getPitch

      public static float getPitch(Vector vector)
    • setYaw

      public static Vector setYaw(Vector vector, float yaw)
    • setPitch

      public static Vector setPitch(Vector vector, float pitch)
    • rotX

      public static Vector rotX(Vector vector, double angle)
    • rotY

      public static Vector rotY(Vector vector, double angle)
    • rotZ

      public static Vector rotZ(Vector vector, double angle)
    • rot

      public static Vector rot(Vector vector, 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(Vector vector1, Vector vector2)
      Copies vector components of vector2 into vector1.
    • isZero

      public static boolean isZero(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