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
statictransformMatrix(matTRS:Matrix3D, pos:Vector3D, rotEuler:Vector3D, scale:Vector3D, eulerOrder:EulerOrder = 0):Matrix3D
staticcreateTransform(pos:Vector3D, rotEuler:Vector3D, scale:Vector3D, eulerOrder:EulerOrder = 0):Matrix3D
staticinlinefastIdentity(matrix:Matrix3D):Void
Allocationless identity matrix (OpenFL allocates a new Vector)
staticfastTranspose(matrix:Matrix3D):Matrix3D
Allocationless transpose (OpenFL copies the whole Vector)
staticfastAppendScale(matrix:Matrix3D, x:Float = 1, y:Float = 1, z:Float = 1):Matrix3D
Allocationless scale append (OpenFL creates another matrix and vector from an array)
Also with reduced operations by simplifying the rest of the matrix
staticalloclessAppendRotation(matrix:Matrix3D, radian:Float, axis:Vector3D):Void
Allocationless rotation append (OpenFL creates another Matrix)
Note: Pivot point argument is no longer present, translate the matrix manually before and after rotation, this also simplifies calculations...
Note2: This makes use of the internal temporary matrix, make sure you're not overlapping it with itself as the input
staticglslInverseMat4(matrix:Matrix3D):Bool
Inverts a matrix (GLSL-based), this is also faster
Returns:
Wheter or not the matrix is invertable
staticinlinelookAt(matrix:Matrix3D, pos:Vector3D, ?at:Vector3D, ?up:Vector3D):Matrix3D
Based on Matrix3D's pointAt, but allocationless.
Note: This makes use of temporary vectors
https://stackoverflow.com/questions/349050/calculating-a-lookat-matrix
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
staticinlineeulerFromQuaternion(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.
staticquaternionFromEulerComponent(x:Float, y:Float, z:Float, ?output:Vector3D):Vector3D
From OpenFL's Matrix3D.recompose(EULER_ANGLES) -> decompose(QUATERNION), allocationless.
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.
staticinlinedirection1D(dir:Float):Int
Returns the direction of a 1D value (similar to sign, but can be 0)
staticinlineglslMod(a:Float, b:Float):Float
GLSL euclidean modulo operation, always unsigned
From Flixel 6's FlxMath, but here for older versions