Contents
Class Vector3dUtil
java.lang.Object
com.hypixel.hytale.math.vector.Vector3dUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.joml.Vector3dcstatic final Vector3dArrayCodecDeprecated.static final org.joml.Vector3dcstatic final BuilderCodec<org.joml.Vector3d> The codec used to parse aVector3dinstance.static final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dcstatic final org.joml.Vector3dc -
Method Summary
Modifier and TypeMethodDescriptionstatic org.joml.Vector3dclipToZero(org.joml.Vector3d vec, double epsilon) static booleancloseToZero(org.joml.Vector3d vec, double epsilon) Called to check if the vector is close to zero within an epsilon.static org.joml.Vector3ddirectionTo(org.joml.Vector3dc from, org.joml.Vector3dc to) Called to compute the normalized direction from one vector to another.static StringformatShortString(org.joml.Vector3dc v) Called to format a vector as a short string.static org.joml.Vector3dquadraticBezier(org.joml.Vector3dc p0, org.joml.Vector3dc control, org.joml.Vector3dc p1, double t, org.joml.Vector3d dest) Samples a quadratic bezier attfromp0top1, bending towardcontrol, intodest.static voidsanitizeNonFinite(org.joml.Vector3d v) Replaces any non-finite component (NaN or infinity) of the given vector with0, in place.static org.joml.Vector3dsetYawPitch(double yaw, double pitch, org.joml.Vector3d dest) Sets a vector to the forward direction for a given yaw and pitchstatic org.joml.Vector3itoVector3i(org.joml.Vector3d v)
-
Field Details
-
CODEC
The codec used to parse aVector3dinstance. -
AS_ARRAY_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 -
RIGHT
public static final org.joml.Vector3dc RIGHT -
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 with0, 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 attfromp0top1, bending towardcontrol, intodest.- Parameters:
p0- the start point at t = 0control- the control point the curve bends towardp1- the end point at t = 1t- the curve parameter in [0, 1]dest- will hold the result- Returns:
- dest
-
formatShortString
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:
trueif the vector is close to zero,falseotherwise.
-