Class TMath
java.lang.Object
com.ticxo.modelengine.api.utils.math.TMath
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
protected static double
static final double
static final double
protected static TMath.SlerpMode
static final double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.util.EulerAngle
add
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b) static int
biasRound
(double val, double res) static float
byteToRot
(byte rot) static double
clamp
(double value, double min, double max) static float
clamp
(float value, float min, float max) static float
degreeDifference
(float a, float b) static double
fastAsin
(double val) static double
fastAtan
(double val) static double
fastAtan2
(double y, double x) static double
fastInvSqrt
(double value) static float
fastInvSqrt
(float value) static double
fastLength
(double x, double y, double z) static org.bukkit.util.Vector
fastNormalize
(org.bukkit.util.Vector vector) static double
fastSqrt
(double value) static float
fastSqrt
(float value) static org.bukkit.util.EulerAngle
globalRotate
(org.bukkit.util.EulerAngle origin, org.bukkit.util.EulerAngle delta) 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
(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 Quaternion
lerp
(Quaternion a, Quaternion b, double aT, double 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.bukkit.util.EulerAngle
localRotate
(org.bukkit.util.EulerAngle origin, org.bukkit.util.EulerAngle delta) static org.bukkit.util.EulerAngle
makeAngle
(double x, double y, double z) static Quaternion
onlerp
(Quaternion a, Quaternion b, double t) 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 Quaternion
slerp
(Quaternion a, Quaternion b, double t) static org.bukkit.util.EulerAngle
slerp
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle 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 Quaternion
smoothOnlerp
(Quaternion a, Quaternion b, Quaternion c, Quaternion d, double t) static org.bukkit.util.EulerAngle
smoothSlerp
(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, org.bukkit.util.EulerAngle c, org.bukkit.util.EulerAngle d, double t) static Quaternion
smoothTSlerp
(Quaternion a, Quaternion b, Quaternion c, Quaternion d, double t) static String
toString
(org.bukkit.util.EulerAngle angle) static double
static Quaternion
tSlerp
(Quaternion a, Quaternion b, double t) static Quaternion
tSlerp
(Quaternion a, Quaternion b, double aT, double bT) static void
static float
wrapDegree
(float r) static float
wrapRadian
(float r)
-
Field Details
-
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:
-
slerpMode
-
movementResolution
protected static double movementResolution
-
-
Constructor Details
-
TMath
public TMath()
-
-
Method Details
-
updateConfigs
public static void updateConfigs() -
clamp
public static double clamp(double value, double min, double max) -
clamp
public static float clamp(float value, float min, float max) -
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) -
globalRotate
public static org.bukkit.util.EulerAngle globalRotate(org.bukkit.util.EulerAngle origin, org.bukkit.util.EulerAngle delta) -
localRotate
public static org.bukkit.util.EulerAngle localRotate(org.bukkit.util.EulerAngle origin, org.bukkit.util.EulerAngle delta) -
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) -
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) -
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) -
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.bukkit.util.EulerAngle slerp(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, double t) -
lerp
-
onlerp
-
smoothOnlerp
public static Quaternion smoothOnlerp(Quaternion a, Quaternion b, Quaternion c, Quaternion d, double t) -
tSlerp
-
tSlerp
-
smoothTSlerp
public static Quaternion smoothTSlerp(Quaternion a, Quaternion b, Quaternion c, Quaternion d, double t) -
slerp
-
smoothSlerp
public static org.bukkit.util.EulerAngle smoothSlerp(org.bukkit.util.EulerAngle a, org.bukkit.util.EulerAngle b, org.bukkit.util.EulerAngle c, org.bukkit.util.EulerAngle d, double t) -
toString
-
fastSqrt
public static float fastSqrt(float value) -
fastSqrt
public static double fastSqrt(double value) -
fastInvSqrt
public static float fastInvSqrt(float value) -
fastInvSqrt
public static double fastInvSqrt(double value) -
fastAsin
public static double fastAsin(double val) -
fastAtan
public static double fastAtan(double val) -
fastAtan2
public static double fastAtan2(double y, double x) -
fastLength
public static double fastLength(double x, double y, double z) -
fastNormalize
public static org.bukkit.util.Vector fastNormalize(org.bukkit.util.Vector vector) -
biasRound
public static int biasRound(double val, double res)
-