class FoxMathUtil
package foxlite.math
Static variables
staticfinalread onlyMATRIX_IDENTITY:Vector<Float> = VectorFactory.Float([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
Cached Identity values so no allocation happens when calling openfl's Matrix3D.identity()
staticfinalread onlyMATRIX_DIRECTIONS:ReadOnlyArray<Matrix3D> = [new Matrix3D(), new Matrix3D(), new Matrix3D(), new Matrix3D(), new Matrix3D(), new Matrix3D()]
A list of matrix directions corresponding to FoxCubemapSide.
Note: The offsets of the matrices can change so it represents positions aswell,
if you want it to be at the origin, set matrix.position to FoxMathUtil.ZERO
Static methods
staticeulerFromMatrix(m:Matrix3D, ?output:Vector3D, ?scale:Vector3D):Vector3D
Extracts the euler angles aka rotation from a transform matrix.
Warning! This assumes the scale is 1, if the scale is other than 1, the rotation will not be accurate and weird things can happen! Make sure to provide a scale vector to fix this if needed.
Note: XYZ order only
staticeulerFromQuaternion(quat:Vector3D, ?output:Vector3D):Vector3D
Converts a quaternion rotation to euler angles. This operation is not safely reversible.
Note: This expects the quaternion vector to be normalized.
staticscaleFromMatrix(m:Matrix3D, ?output:Vector3D):Vector3D
Extracts the scale from a transform matrix.
Make sure to apply this first before extracting euler angles too if needed.