MathUtils
object MathUtils
A collection of math utility functions.
Ported from three.js MathUtils. Modelled as a Kotlin object so that ported three.js code keeps calling MathUtils.clamp(...) etc. verbatim.
Properties
Functions
Link copied to clipboard
Returns the smallest power of two greater than or equal to value (which must be greater than 0).
Link copied to clipboard
Link copied to clipboard
Computes the Euclidean modulo ((n % m) + m) % m.
Link copied to clipboard
Returns the largest power of two less than or equal to value (which must be greater than 0).
Link copied to clipboard
Generates a UUID.
Link copied to clipboard
Link copied to clipboard
Returns true if value is a power of two.
Link copied to clipboard
Returns a random float in the interval (-range/2, range/2).
Link copied to clipboard
Returns a deterministic pseudo-random float in [0, 1) (Mulberry32).
Link copied to clipboard
fun setQuaternionFromProperEuler(q: Quaternion, a: Double, b: Double, c: Double, order: ProperEulerOrder)
Link copied to clipboard
Smootherstep: a variation on smoothstep with zero 1st and 2nd derivatives at both ends.
Link copied to clipboard