java.lang.Object
com.ticxo.modelengine.api.utils.math.TMath

public class TMath extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
    static final double
     
    static final double
     
    static final float
     
    static final float
     
    static final float
     
    protected static float
     
    protected static double
     
    static final float
     
    static final double
     
    static final double
     
    static final float
     
    static final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 void
    clampedScale(org.joml.Matrix4f mat, org.joml.Vector3f scale)
     
    static org.bukkit.util.Transformation
     
    static float
    degreeDifference(float a, float b)
     
    static double
    distanceSquaredToBoundingBox(org.bukkit.util.Vector origin, org.bukkit.util.BoundingBox box)
     
    static org.joml.Vector3d
    fixEuler(org.joml.Vector3d v)
     
    static org.joml.Quaterniond
    fixQuaternion(org.joml.Quaterniond q)
     
    static org.joml.Quaternionf
    fixQuaternion(org.joml.Quaternionf q)
     
    static org.joml.Vector3d
    fixVector(org.joml.Vector3d v)
     
    static org.joml.Vector3f
    fixVector(org.joml.Vector3f v)
     
    static int
    floor(double val)
     
    static org.joml.Quaterniond
    fromEulerXYZ(org.joml.Vector3d euler)
     
    static org.joml.Quaterniond
    fromEulerZYX(org.joml.Vector3d euler)
     
    static boolean
    getBit(byte dataItem, int bitOffset)
     
    static org.joml.Vector3d
    getEulerAnglesZYX(org.joml.Quaterniond quat, org.joml.Vector3d eulerAngles)
     
    static org.joml.Vector3f
    getEulerAnglesZYX(org.joml.Quaternionf quat, org.joml.Vector3f eulerAngles)
     
    static double
    invLerp(double a, double b, double l)
     
    static float
    invLerp(float a, float b, float l)
     
    static boolean
    isAlmostBetween(double val, double min, double max)
     
    static boolean
    isBoundingBoxWithinDistance(@NotNull org.bukkit.util.Vector start, @NotNull org.bukkit.util.Vector direction, org.bukkit.util.BoundingBox boundingBox, double maxDistance)
     
    static boolean
    isInterval(double value, double interval)
     
    static boolean
    isSimilar(double a, double b)
     
    static boolean
    isSimilar(float a, float b)
     
    static boolean
    isSimilar(float a, float b, float epsilon)
     
    static boolean
    isSimilar(org.bukkit.util.Vector a, org.bukkit.util.Vector b)
     
    static boolean
    isSimilar(org.joml.Quaternionf a, org.joml.Quaternionf b)
     
    static boolean
    isSimilar(org.joml.Vector3f a, org.joml.Vector3f 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 t)
     
    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 org.joml.Vector3d
    matToEulerXYZ(org.joml.Matrix3d mat, org.joml.Vector3d result)
     
    static org.joml.Vector3d
    matToEulerZYX(org.joml.Matrix3d mat, org.joml.Vector3d result)
     
    static org.joml.Vector3f
    matToEulerZYX(org.joml.Matrix3f mat, org.joml.Vector3f result)
     
    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 org.joml.Vector3d
    toEulerXYZ(org.joml.Quaterniond quaternion)
     
    static org.joml.Vector3d
    toEulerZYX(org.joml.Quaterniond quaternion)
     
    static org.joml.Vector3f
    toEulerZYX(org.joml.Quaternionf quaternion, org.joml.Vector3f dest)
     
    static org.joml.Vector3f
    toPitchYaw(org.joml.Vector3f dir)
     
    static org.joml.Quaternionf
    toQuaternion(org.joml.Vector3f euler)
     
    static org.joml.Quaternionf
    toQuaternion(org.joml.Vector3f euler, org.joml.Quaternionf dest)
     
    static String
    toString(org.bukkit.util.EulerAngle angle)
     
    static org.joml.Vector3f
    transform(org.joml.Matrix4f transform, org.joml.Vector3f pos)
     
    static double
    tryParse(String val, double def)
     
    static int
    tryParse(String val, int def)
     
    static float[]
    unwrap(org.joml.Vector3d vec)
     
    static float[]
    unwrap(org.joml.Vector3f vec)
     
    static org.joml.Vector3f
    wrap(Float[] vec)
     
    static float
    wrapDegree(float r)
     
    static float
    wrapRadian(float r)
     
    static org.joml.Vector3f
    zerofyScale(org.joml.Vector3f vec)
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • TMath

      public TMath()
  • Method Details

    • isSimilar

      public static boolean isSimilar(float a, float b)
    • isSimilar

      public static boolean isSimilar(double a, double b)
    • isSimilar

      public static boolean isSimilar(float a, float b, float epsilon)
    • isSimilar

      public static boolean isSimilar(org.joml.Vector3f a, org.joml.Vector3f b)
    • isSimilar

      public static boolean isSimilar(org.joml.Quaternionf a, org.joml.Quaternionf 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

      public static int tryParse(String val, int def)
    • tryParse

      public static double tryParse(String val, double def)
    • 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)
    • distanceSquaredToBoundingBox

      public static double distanceSquaredToBoundingBox(org.bukkit.util.Vector origin, org.bukkit.util.BoundingBox box)
    • 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)
    • invLerp

      public static double invLerp(double a, double b, double l)
    • lerp

      public static float lerp(float a, float b, float t)
    • invLerp

      public static float invLerp(float a, float b, float l)
    • 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 quat, org.joml.Vector3f eulerAngles)
    • matToEulerZYX

      public static org.joml.Vector3f matToEulerZYX(org.joml.Matrix3f mat, org.joml.Vector3f result)
    • getEulerAnglesZYX

      public static org.joml.Vector3d getEulerAnglesZYX(org.joml.Quaterniond quat, org.joml.Vector3d eulerAngles)
    • matToEulerZYX

      public static org.joml.Vector3d matToEulerZYX(org.joml.Matrix3d mat, org.joml.Vector3d result)
    • toEulerZYX

      public static org.joml.Vector3f toEulerZYX(org.joml.Quaternionf quaternion, org.joml.Vector3f dest)
    • toEulerZYX

      public static org.joml.Vector3d toEulerZYX(org.joml.Quaterniond quaternion)
    • toEulerXYZ

      public static org.joml.Vector3d toEulerXYZ(org.joml.Quaterniond quaternion)
    • matToEulerXYZ

      public static org.joml.Vector3d matToEulerXYZ(org.joml.Matrix3d mat, org.joml.Vector3d result)
    • fromEulerZYX

      public static org.joml.Quaterniond fromEulerZYX(org.joml.Vector3d euler)
    • fromEulerXYZ

      public static org.joml.Quaterniond fromEulerXYZ(org.joml.Vector3d euler)
    • isInterval

      public static boolean isInterval(double value, double interval)
    • isAlmostBetween

      public static boolean isAlmostBetween(double val, double min, double max)
    • toPitchYaw

      public static org.joml.Vector3f toPitchYaw(org.joml.Vector3f dir)
    • toQuaternion

      public static org.joml.Quaternionf toQuaternion(org.joml.Vector3f euler)
    • toQuaternion

      public static org.joml.Quaternionf toQuaternion(org.joml.Vector3f euler, org.joml.Quaternionf dest)
    • fixVector

      public static org.joml.Vector3f fixVector(org.joml.Vector3f v)
    • fixVector

      public static org.joml.Vector3d fixVector(org.joml.Vector3d v)
    • fixEuler

      public static org.joml.Vector3d fixEuler(org.joml.Vector3d v)
    • fixQuaternion

      public static org.joml.Quaternionf fixQuaternion(org.joml.Quaternionf q)
    • fixQuaternion

      public static org.joml.Quaterniond fixQuaternion(org.joml.Quaterniond q)
    • wrap

      public static org.joml.Vector3f wrap(Float[] vec)
    • unwrap

      public static float[] unwrap(org.joml.Vector3f vec)
    • unwrap

      public static float[] unwrap(org.joml.Vector3d vec)
    • createIdentityTransform

      public static org.bukkit.util.Transformation createIdentityTransform()
    • transform

      public static org.joml.Vector3f transform(org.joml.Matrix4f transform, org.joml.Vector3f pos)
    • clampedScale

      public static void clampedScale(org.joml.Matrix4f mat, org.joml.Vector3f scale)
    • zerofyScale

      public static org.joml.Vector3f zerofyScale(org.joml.Vector3f vec)
    • toString

      public static String toString(org.bukkit.util.EulerAngle angle)
    • parseUUID

      public static UUID parseUUID(String uuid)