MathUtil

@ApiStatus.Internal
class MathUtil

Math

Properties

Link copied to clipboard
val DEGREES_TO_PACKED_BYTE: Float = 0.7111111f
Degrees to packed byte
Link copied to clipboard
val DEGREES_TO_RADIANS: Float = 0.017453292f
Degrees to radians
Link copied to clipboard
Float comparison epsilon value
Link copied to clipboard
val FRAME_COMPARATOR: FloatComparator
Float comparator
Link copied to clipboard
val FRAME_EPSILON: Float = 0.001f
Frame epsilon value
Link copied to clipboard
Minecraft tick mills
Link copied to clipboard
Multiplier value for convert model size to block size
Link copied to clipboard
val RADIANS_TO_DEGREES: Float = 57.29578f
Radians to degrees
Link copied to clipboard
val ROTATION_DEGREE: Float = 22.5f
Valid rotation degree

Functions

Link copied to clipboard
open fun checkValidDegree(rotation: Float): Boolean
Checks this float is valid Minecraft degree
open fun checkValidDegree(@NotNull rotation: @NotNull Float3): Boolean
Checks these floats are valid Minecraft degree
Link copied to clipboard
open fun fma(a: Double, b: Double, c: Double): Double
open fun fma(a: Float, b: Float, c: Float): Float
@NotNull
open fun fma(@NotNull a: @NotNull Vector3f, b: Float, @NotNull c: @NotNull Vector3f): @NotNull Vector3f
@NotNull
open fun fma(@NotNull a: @NotNull Vector3f, @NotNull b: @NotNull Vector3f, @NotNull c: @NotNull Vector3f): @NotNull Vector3f
Executes fused multiply add (a * b + c)
Link copied to clipboard
@NotNull
open fun fromToRotation(@NotNull to: @NotNull Vector3f): @NotNull Quaternionf
Gets rotation from vectors
@NotNull
open fun fromToRotation(@NotNull from: @NotNull Vector3f, @NotNull to: @NotNull Vector3f): @NotNull Quaternionf
Gets rotation from two vectors
Link copied to clipboard
@NotNull
open fun identifier(@NotNull rotation: @NotNull Float3): @NotNull Float3
Creates rotation identifier
Link copied to clipboard
open fun isNotZero(@NotNull vector3f: @NotNull Vector3f): Boolean
Checks this vector is not zero
Link copied to clipboard
open fun isSimilar(a: Float, b: Float): Boolean
open fun isSimilar(a: Float, b: Float, epsilon: Float): Boolean
Checks two floats are similar.
open fun isSimilar(@NotNull a: @NotNull Quaternionf, @NotNull b: @NotNull Quaternionf): Boolean
open fun isSimilar(@NotNull a: @NotNull Quaternionf, @NotNull b: @NotNull Quaternionf, epsilon: Float): Boolean
Checks two quaternion are similar.
open fun isSimilar(@NotNull a: @NotNull Vector3f, @NotNull b: @NotNull Vector3f): Boolean
open fun isSimilar(@NotNull a: @NotNull Vector3f, @NotNull b: @NotNull Vector3f, epsilon: Float): Boolean
Checks two vectors are similar.
Link copied to clipboard
open fun isZero(@NotNull vector3f: @NotNull Vector3f): Boolean
Checks this vector is zero
Link copied to clipboard
open fun similarHashCode(value: Float): Int
Creates epsilon-based hashcode of given float
Link copied to clipboard
@NotNull
open fun toMatrix(@NotNull quaternion: @NotNull Quaternionf): @NotNull Matrix3f
Gets rotation matrix of quaternion
Link copied to clipboard
@NotNull
open fun toQuaternion(@NotNull vector: @NotNull Vector3f): @NotNull Quaternionf
Converts vector rotation to quaternion
Link copied to clipboard
@NotNull
open fun toXYZEuler(@NotNull mat: @NotNull Matrix3f): @NotNull Vector3f
Gets xyz euler of this matrix
@NotNull
open fun toXYZEuler(@NotNull quaternion: @NotNull Quaternionf): @NotNull Vector3f
Converts quaternion to xyz euler
@NotNull
open fun toXYZEuler(@NotNull vec: @NotNull Vector3f): @NotNull Vector3f
Converts zyx euler to xyz euler