Class TMath
java.lang.Object
com.ticxo.modelengine.api.utils.math.TMath
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
static final double
protected static double
static final float
static final double
static final double
static final float
protected static TMath.SlerpMode
static final double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
absMax
(float a, float b, float c) static org.bukkit.util.EulerAngle
add
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b) static float
byteToRot
(byte rot) static int
ceil
(double val) static double
clamp
(double value, double min, double max) static float
clamp
(float value, float min, float max) static int
clamp
(int value, int min, int max) static float
degreeDifference
(float a, float b) static int
floor
(double val) static boolean
getBit
(byte dataItem, int bitOffset) static org.joml.Vector3d
getEulerAnglesZYX
(org.joml.Quaterniond quaterniond, org.joml.Vector3d eulerAngles) static org.joml.Vector3f
getEulerAnglesZYX
(org.joml.Quaternionf quaternionf, org.joml.Vector3f eulerAngles) static boolean
isBoundingBoxWithinDistance
(@NotNull org.bukkit.util.Vector start, @NotNull org.bukkit.util.Vector direction, org.bukkit.util.BoundingBox boundingBox, double maxDistance) static boolean
isSimilar
(float a, float b) static boolean
isSimilar
(org.bukkit.util.Vector a, org.bukkit.util.Vector b) static double
lerp
(double a, double b, double t) static double
lerp
(double a, double b, double aT, double bT) static float
lerp
(float a, float b, float aT, float bT) static org.bukkit.util.EulerAngle
lerp
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, double t) static org.bukkit.util.EulerAngle
lerp
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, double aT, double bT) static org.bukkit.util.Vector
lerp
(org.bukkit.util.Vector a, org.bukkit.util.Vector b, double t) static org.bukkit.util.Vector
lerp
(org.bukkit.util.Vector a, org.bukkit.util.Vector b, double aT, double bT) static org.joml.Vector3f
lerp
(org.joml.Vector3f a, org.joml.Vector3f b, double t) static org.joml.Vector3f
lerp
(org.joml.Vector3f a, org.joml.Vector3f b, float aT, float bT) static org.bukkit.util.EulerAngle
makeAngle
(double x, double y, double z) static UUID
static float
radianDifference
(float a, float b) static float
rotateIfNecessary
(float current, float target, float negativeClamp, float positiveClamp) static double
rotLerp
(double a, double b, double t) static float
rotLerp
(float a, float b, double t) static byte
rotToByte
(float rot) static byte
setBit
(byte dataItem, int bitOffset, boolean flag) static org.joml.Vector3f
slerp
(org.joml.Vector3f a, org.joml.Vector3f b, double t) static double
smoothLerp
(double a, double b, double c, double d, double t) static org.bukkit.util.EulerAngle
smoothLerp
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, org.bukkit.util.EulerAngle c, org.bukkit.util.EulerAngle d, double t) static org.bukkit.util.Vector
smoothLerp
(org.bukkit.util.Vector a, org.bukkit.util.Vector b, org.bukkit.util.Vector c, org.bukkit.util.Vector d, double t) static org.joml.Vector3f
smoothLerp
(org.joml.Vector3f a, org.joml.Vector3f b, org.joml.Vector3f c, org.joml.Vector3f d, float t) static String
toString
(org.bukkit.util.EulerAngle angle) static double
static float
wrapDegree
(float r) static float
wrapRadian
(float r)
-
Field Details
-
PI
public static final float PI- See Also:
-
TAU
public static final double TAU- See Also:
-
PI_2
public static final double PI_2- See Also:
-
PI_4
public static final double PI_4- See Also:
-
EPSILON
public static final double EPSILON- See Also:
-
DEG2RAD
public static final float DEG2RAD- See Also:
-
RAD2DEG
public static final float RAD2DEG- See Also:
-
slerpMode
-
movementResolution
protected static double movementResolution
-
-
Constructor Details
-
TMath
public TMath()
-
-
Method Details
-
isSimilar
public static boolean isSimilar(float a, float b) -
clamp
public static double clamp(double value, double min, double max) -
clamp
public static float clamp(float value, float min, float max) -
clamp
public static int clamp(int value, int min, int max) -
absMax
public static int absMax(float a, float b, float c) -
setBit
public static byte setBit(byte dataItem, int bitOffset, boolean flag) -
getBit
public static boolean getBit(byte dataItem, int bitOffset) -
floor
public static int floor(double val) -
ceil
public static int ceil(double val) -
tryParse
-
isBoundingBoxWithinDistance
public static boolean isBoundingBoxWithinDistance(@NotNull @NotNull org.bukkit.util.Vector start, @NotNull @NotNull org.bukkit.util.Vector direction, org.bukkit.util.BoundingBox boundingBox, double maxDistance) -
isSimilar
public static boolean isSimilar(org.bukkit.util.Vector a, org.bukkit.util.Vector b) -
makeAngle
public static org.bukkit.util.EulerAngle makeAngle(double x, double y, double z) -
add
public static org.bukkit.util.EulerAngle add(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b) -
wrapRadian
public static float wrapRadian(float r) -
wrapDegree
public static float wrapDegree(float r) -
radianDifference
public static float radianDifference(float a, float b) -
degreeDifference
public static float degreeDifference(float a, float b) -
rotateIfNecessary
public static float rotateIfNecessary(float current, float target, float negativeClamp, float positiveClamp) -
rotToByte
public static byte rotToByte(float rot) -
byteToRot
public static float byteToRot(byte rot) -
lerp
public static double lerp(double a, double b, double t) -
lerp
public static double lerp(double a, double b, double aT, double bT) -
lerp
public static float lerp(float a, float b, float aT, float bT) -
rotLerp
public static double rotLerp(double a, double b, double t) -
rotLerp
public static float rotLerp(float a, float b, double t) -
smoothLerp
public static double smoothLerp(double a, double b, double c, double d, double t) -
lerp
public static org.bukkit.util.Vector lerp(org.bukkit.util.Vector a, org.bukkit.util.Vector b, double t) -
lerp
public static org.bukkit.util.Vector lerp(org.bukkit.util.Vector a, org.bukkit.util.Vector b, double aT, double bT) -
lerp
public static org.joml.Vector3f lerp(org.joml.Vector3f a, org.joml.Vector3f b, double t) -
lerp
public static org.joml.Vector3f lerp(org.joml.Vector3f a, org.joml.Vector3f b, float aT, float bT) -
smoothLerp
public static org.bukkit.util.Vector smoothLerp(org.bukkit.util.Vector a, org.bukkit.util.Vector b, org.bukkit.util.Vector c, org.bukkit.util.Vector d, double t) -
smoothLerp
public static org.joml.Vector3f smoothLerp(org.joml.Vector3f a, org.joml.Vector3f b, org.joml.Vector3f c, org.joml.Vector3f d, float t) -
lerp
public static org.bukkit.util.EulerAngle lerp(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, double t) -
lerp
public static org.bukkit.util.EulerAngle lerp(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, double aT, double bT) -
smoothLerp
public static org.bukkit.util.EulerAngle smoothLerp(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, org.bukkit.util.EulerAngle c, org.bukkit.util.EulerAngle d, double t) -
slerp
public static org.joml.Vector3f slerp(org.joml.Vector3f a, org.joml.Vector3f b, double t) -
getEulerAnglesZYX
public static org.joml.Vector3f getEulerAnglesZYX(org.joml.Quaternionf quaternionf, org.joml.Vector3f eulerAngles) -
getEulerAnglesZYX
public static org.joml.Vector3d getEulerAnglesZYX(org.joml.Quaterniond quaterniond, org.joml.Vector3d eulerAngles) -
toString
-
parseUUID
-