Class Vector3dUtil

java.lang.Object
com.hypixel.hytale.math.vector.Vector3dUtil

public final class Vector3dUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.joml.Vector3dc
     
    static final Vector3dArrayCodec
    Deprecated.
    static final org.joml.Vector3dc
     
    static final BuilderCodec<org.joml.Vector3d>
    The codec used to parse a Vector3d instance.
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
    static final org.joml.Vector3dc
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.joml.Vector3d
    clipToZero(org.joml.Vector3d vec, double epsilon)
     
    static boolean
    closeToZero(org.joml.Vector3d vec, double epsilon)
    Called to check if the vector is close to zero within an epsilon.
    static org.joml.Vector3d
    directionTo(org.joml.Vector3dc from, org.joml.Vector3dc to)
    Called to compute the normalized direction from one vector to another.
    static String
    formatShortString(org.joml.Vector3dc v)
    Called to format a vector as a short string.
    static org.joml.Vector3d
    quadraticBezier(org.joml.Vector3dc p0, org.joml.Vector3dc control, org.joml.Vector3dc p1, double t, org.joml.Vector3d dest)
    Samples a quadratic bezier at t from p0 to p1, bending toward control, into dest.
    static void
    sanitizeNonFinite(org.joml.Vector3d v)
    Replaces any non-finite component (NaN or infinity) of the given vector with 0, in place.
    static org.joml.Vector3d
    setYawPitch(double yaw, double pitch, org.joml.Vector3d dest)
    Sets a vector to the forward direction for a given yaw and pitch
    static org.joml.Vector3i
    toVector3i(org.joml.Vector3d v)
     

    Methods inherited from class Object

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

    • CODEC

      @Nonnull public static final BuilderCodec<org.joml.Vector3d> CODEC
      The codec used to parse a Vector3d instance.
    • AS_ARRAY_CODEC

      @Deprecated public static final Vector3dArrayCodec AS_ARRAY_CODEC
      Deprecated.
      Replaced with CODEC
    • ZERO

      public static final org.joml.Vector3dc ZERO
    • UP

      public static final org.joml.Vector3dc UP
    • POS_Y

      public static final org.joml.Vector3dc POS_Y
    • DOWN

      public static final org.joml.Vector3dc DOWN
    • NEG_Y

      public static final org.joml.Vector3dc NEG_Y
    • FORWARD

      public static final org.joml.Vector3dc FORWARD
    • NEG_Z

      public static final org.joml.Vector3dc NEG_Z
    • NORTH

      public static final org.joml.Vector3dc NORTH
    • BACKWARD

      public static final org.joml.Vector3dc BACKWARD
    • POS_Z

      public static final org.joml.Vector3dc POS_Z
    • SOUTH

      public static final org.joml.Vector3dc SOUTH
    • POS_X

      public static final org.joml.Vector3dc POS_X
    • EAST

      public static final org.joml.Vector3dc EAST
    • LEFT

      public static final org.joml.Vector3dc LEFT
    • NEG_X

      public static final org.joml.Vector3dc NEG_X
    • WEST

      public static final org.joml.Vector3dc WEST
    • ALL_ONES

      public static final org.joml.Vector3dc ALL_ONES
    • MIN

      public static final org.joml.Vector3dc MIN
    • MAX

      public static final org.joml.Vector3dc MAX
  • Method Details

    • setYawPitch

      public static org.joml.Vector3d setYawPitch(double yaw, double pitch, @Nonnull org.joml.Vector3d dest)
      Sets a vector to the forward direction for a given yaw and pitch
      Parameters:
      yaw - yaw [rad]
      pitch - pitch [rad]
      dest - will hold the result
      Returns:
      dest
    • directionTo

      @Nonnull public static org.joml.Vector3d directionTo(@Nonnull org.joml.Vector3dc from, @Nonnull org.joml.Vector3dc to)
      Called to compute the normalized direction from one vector to another.
      Parameters:
      from - The start vector.
      to - The end vector.
      Returns:
      the normalized direction vector.
    • sanitizeNonFinite

      public static void sanitizeNonFinite(@Nonnull org.joml.Vector3d v)
      Replaces any non-finite component (NaN or infinity) of the given vector with 0, in place.
      Parameters:
      v - the vector to sanitize.
    • quadraticBezier

      @Nonnull public static org.joml.Vector3d quadraticBezier(@Nonnull org.joml.Vector3dc p0, @Nonnull org.joml.Vector3dc control, @Nonnull org.joml.Vector3dc p1, double t, @Nonnull org.joml.Vector3d dest)
      Samples a quadratic bezier at t from p0 to p1, bending toward control, into dest.
      Parameters:
      p0 - the start point at t = 0
      control - the control point the curve bends toward
      p1 - the end point at t = 1
      t - the curve parameter in [0, 1]
      dest - will hold the result
      Returns:
      dest
    • formatShortString

      @Nonnull public static String formatShortString(@Nullable org.joml.Vector3dc v)
      Called to format a vector as a short string.
      Parameters:
      v - The vector.
      Returns:
      the formatted string.
    • toVector3i

      public static org.joml.Vector3i toVector3i(@Nonnull org.joml.Vector3d v)
    • clipToZero

      public static org.joml.Vector3d clipToZero(org.joml.Vector3d vec, double epsilon)
    • closeToZero

      public static boolean closeToZero(@Nonnull org.joml.Vector3d vec, double epsilon)
      Called to check if the vector is close to zero within an epsilon.
      Parameters:
      epsilon - The epsilon to use.
      Returns:
      true if the vector is close to zero, false otherwise.