Static variables

@:value(0.0174532925199433)staticfinalinlineread onlydegToRad:Float = 0.0174532925199433

@:value(57.2957795130823209)staticfinalinlineread onlyradToDeg:Float = 57.2957795130823209

@:value(6.2831853071795865)staticfinalinlineread onlyTAU:Float = 6.2831853071795865

@:value(1.5707963267948967)staticfinalinlineread onlyPI_2:Float = 1.5707963267948967

@:value(0.6931471805599453)staticfinalinlineread onlyLN2:Float = 0.6931471805599453

@:value(new Vector3D())staticfinalread only__tempVector:Vector3D = new Vector3D()

Cache temporary vectors

@:value(new Vector3D())staticfinalread only__tempVector2:Vector3D = new Vector3D()

@:value(new Vector3D())staticfinalread only__tempVector3:Vector3D = new Vector3D()

@:value(new Matrix3D())staticfinalread only__tempMatrix:Matrix3D = new Matrix3D()

Cache temporary matrices

@:value(new Matrix3D())staticfinalread only__tempMatrix2:Matrix3D = new Matrix3D()

@:value(VectorFactory.Float([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]))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()

@:value(new Vector3D(1, 0, 0))staticfinalread onlyRIGHT:Vector3D = new Vector3D(1, 0, 0)

@:value(new Vector3D(0, 1, 0))staticfinalread onlyUP:Vector3D = new Vector3D(0, 1, 0)

@:value(new Vector3D(0, 0, -1))staticfinalread onlyFORWARD:Vector3D = new Vector3D(0, 0, -1)

@:value(new Vector3D(-1, 0, 0))staticfinalread onlyLEFT:Vector3D = new Vector3D(-1, 0, 0)

@:value(new Vector3D(0, -1, 0))staticfinalread onlyDOWN:Vector3D = new Vector3D(0, -1, 0)

@:value(new Vector3D(0, 0, 1))staticfinalread onlyBACK:Vector3D = new Vector3D(0, 0, 1)

@:value(new Vector3D(0, 0, 0))staticfinalread onlyZERO:Vector3D = new Vector3D(0, 0, 0)

@:value(new Vector3D(1, 1, 1))staticfinalread onlyONE:Vector3D = new Vector3D(1, 1, 1)

@:value([new Matrix3D(), new Matrix3D(), new Matrix3D(), new Matrix3D(), new Matrix3D(), new Matrix3D()])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

staticstaticInit():Void

staticperspectiveMatrix(mp:Matrix3D, fov:Float, aspect:Float, near:Float, far:Float):Matrix3D

staticperspectiveMatrixClipFast(mp:Matrix3D, near:Float, far:Float):Matrix3D

staticcreatePerspective(fov:Float, aspect:Float, near:Float, far:Float):Matrix3D

staticorthogonalMatrix(mo:Matrix3D, size:Float, aspect:Float, near:Float, far:Float):Matrix3D

staticcreateOrthogonal(size:Float, aspect:Float, near:Float, far:Float):Matrix3D

@:value({ eulerOrder : 0 })statictransformMatrix(matTRS:Matrix3D, pos:Vector3D, rotEuler:Vector3D, scale:Vector3D, eulerOrder:EulerOrder = 0):Matrix3D

@:value({ eulerOrder : 0 })staticbasisMatrix(matR:Matrix3D, rotEuler:Vector3D, eulerOrder:EulerOrder = 0):Matrix3D

staticviewMatrix(matRT:Matrix3D, pos:Vector3D, rotEuler:Vector3D):Matrix3D

staticinlineviewMatrixFromTransform(output:Matrix3D, transform:Matrix3D):Matrix3D

@:value({ eulerOrder : 0 })staticcreateTransform(pos:Vector3D, rotEuler:Vector3D, scale:Vector3D, eulerOrder:EulerOrder = 0):Matrix3D

staticcreateViewMatrix(pos:Vector3D, rotEuler:Vector3D):Matrix3D

@:value({ eulerOrder : 0 })staticcreateBasisMatrix(rotEuler: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)

@:value({ z : 1, y : 1, x : 1 })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

staticinlinealloclessAppendRotationDegrees(matrix:Matrix3D, radian:Float, axis:Vector3D):Void

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.

staticeulerFromQuaternionComponent(x:Float, y:Float, z:Float, w:Float, ?output:Vector3D):Vector3D

staticquaternionFromMatrix(matrix:Matrix3D, ?output:Vector3D):Vector3D

staticinlinequaternionFromEuler(rot:Vector3D, ?output:Vector3D):Vector3D

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

staticinlineglslClamp(v:Float, min:Float, max:Float):Float

staticinlineglslClampInt(v:Int, min:Int, max:Int):Int

staticinlineglslLog2(v:Float):Float

Returns the base 2 logarithm of a number

staticdirectionOf(matrix:Matrix3D):Vector3D

staticdirectionOfToOutput(matrix:Matrix3D, output:Vector3D):Vector3D

staticbakeMVP(model:Matrix3D, view:Matrix3D, projection:Matrix3D):Matrix3D

staticbakeMVPToOutput(model:Matrix3D, view:Matrix3D, projection:Matrix3D, output:Matrix3D):Matrix3D