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
Quaternion comparison epsilon value
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
Link copied to clipboard
Squared vector comparison epsilon value

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 floatToHalf(value: Float): Short
Converts a 32-bit float to IEEE 754 half-precision bits.
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 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 Vector3fc, @NotNull b: @NotNull Vector3fc): Boolean
open fun isSimilar(@NotNull a: @NotNull Vector3fc, @NotNull b: @NotNull Vector3fc, epsilon: Float): Boolean
Checks two vectors are similar.
Link copied to clipboard
open fun isZero(@NotNull vector: @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 toQuaternion(@NotNull vector: @NotNull Vector3f): @NotNull Quaternionf
@NotNull
open fun toQuaternion(@NotNull vector: @NotNull Vector3f, @NotNull dest: @NotNull Quaternionf): @NotNull Quaternionf
Converts vector rotation to quaternion
Link copied to clipboard
@NotNull
open fun toXYZEuler(@NotNull vec: @NotNull Vector3f): @NotNull Vector3f
Converts zyx euler to xyz euler