Math functions for Matrix4 calculations.
public static var USE_FAST_MATH:Boolean = false
Should we use the fast math calculations?
Set to true if fast math is used - Default false
public static function addMatrix4(m1:Matrix4, m2:Matrix4):Matrix4
Computes the addition of two Matrix4 matrices.
Parameters
Returns
public static function axisRotation(u:Number, v:Number, w:Number, angle:Number):Matrix4
Computes a rotation Matrix4 matrix for a general axis of rotation.
[ToDo: My gosh! Explain this Thomas ;-) ]
Parameters
| u:Number — rotation X.
|
| |
| v:Number — rotation Y.
|
| |
| w:Number — rotation Z.
|
| |
| angle:Number — The angle of rotation in degrees
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function axisRotationVector(v:Vector, angle:Number):Matrix4
Computes a rotation Matrix4 matrix for a general axis of rotation.
Parameters
| v:Vector — The axis of rotation
|
| |
| angle:Number — The angle of rotation in degrees
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function axisRotationWithReference(axis:Vector, ref:Vector, pAngle:Number):Matrix4
Computes a Matrix4 matrix for a rotation around a specific axis through a specific point.
NOTE - The axis must be normalized!
Parameters
| axis:Vector — A vector representing the axis of rtation.
|
| |
| ref:Vector — The center of rotation.
|
| |
| pAngle:Number — The angle of rotation in degrees.
|
Returns
public static function clone(m:Matrix4):Matrix4
Returns the clone of a Matrix4 matrix.
Parameters
Returns
public static function det(m:Matrix4):Number
Computes the determinant of a Matrix4 matrix.
Parameters
Returns
public static function det3x3(m:Matrix4):Number
Computes the 3x3 determinant of a Matrix4 matrix.
Uses the upper left 3 by 3 elements
Parameters
Returns
public static function eulerRotation(ax:Number, ay:Number, az:Number):Matrix4
Computes a rotation Matrix4 matrix from the Euler angle in degrees.
Parameters
| ax:Number — Angle of rotation around X axis in degrees.
|
| |
| ay:Number — Angle of rotation around Y axis in degrees.
|
| |
| az:Number — Angle of rotation around Z axis in degrees.
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function getInverse(m:Matrix4):Matrix4
Returns the inverse of a Matrix4 matrix.
Parameters
Returns
| Matrix4 —
The inverse Matrix4 matrix
|
public static function getTrace(m:Matrix4):Number
Computes the trace of a Matrix4 matrix.
The trace value is the sum of the element on the diagonal of the matrix
Parameters
| m:Matrix4 — The matrix we want to compute the trace
|
Returns
public static function multiply(m1:Matrix4, m2:Matrix4):Matrix4
Computes the multiplication of two Matrix4 matrices.
[ToDo: Explain this multiplication ]
Parameters
Returns
public static function multiply3x3(m1:Matrix4, m2:Matrix4):Matrix4
Computes the multiplication of two Matrix4 matrices, as if they were 3x3.
Parameters
Returns
See also
sandy.core.data.Matrix4"
public static function multiply4x3(m1:Matrix4, m2:Matrix4):Matrix4
Computes the multiplication of two Matrix4 matrices.
[ToDo: Explain this multiplication ]
Parameters
Returns
public static function rotationX(angle:Number):Matrix4
Computes a rotation Matrix4 matrix for an x axis rotation.
Parameters
| angle:Number — Angle of rotation
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function rotationY(angle:Number):Matrix4
Computes a rotation Matrix4 matrix for an y axis rotation.
Parameters
| angle:Number — Angle of rotation
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function rotationZ(angle:Number):Matrix4
Computes a rotation Matrix4 matrix for an z axis rotation.
Parameters
| angle:Number — Angle of rotation
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function scale(nXScale:Number, nYScale:Number, nZScale:Number):Matrix4
Computes a scale Matrix4 matrix.
|Sx 0 0 0|
|0 Sy 0 0|
|0 0 Sz 0|
|0 0 0 1|
Parameters
| nXScale:Number — Scale factor in the x direction
|
| |
| nYScale:Number — Scale factor in the y direction
|
| |
| nZScale:Number — Scale factor in the z direction
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function scaleVector(v:Vector):Matrix4
Computes a scale Matrix4 matrix from a scale vector.
|Sx 0 0 0|
|0 Sy 0 0|
|0 0 Sz 0|
|0 0 0 1|
Parameters
| v:Vector — The vector containing the scale values
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function translation(nTx:Number, nTy:Number, nTz:Number):Matrix4
Computes a translation Matrix4 matrix.
|1 0 0 0|
|0 1 0 0|
|0 0 1 0|
|Tx Ty Tz 1|
Parameters
| nTx:Number — Translation in the x direction.
|
| |
| nTy:Number — Translation in the y direction.
|
| |
| nTz:Number — Translation in the z direction.
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function translationVector(v:Vector):Matrix4
Computes a translation Matrix4 matrix from a vector.
|1 0 0 0|
|0 1 0 0|
|0 0 1 0|
|Tx Ty Tz 1|
Parameters
| v:Vector — Translation Vector.
|
Returns
| Matrix4 —
The resulting Matrix4 matrix.
|
public static function vectorMult(m:Matrix4, pv:Vector):Vector
Multiplies a 3D vertex by a Matrix4 matrix.
Parameters
Returns
public static function vectorMult3x3(m:Matrix4, pv:Vector):Vector
Multiplies a 3D vector by a Matrix4 matrix as a 3x3 matrix.
Uses the upper left 3 by 3 elements
Parameters
Returns
ASDoc: Preliminary documentation for the Sandy 3D Engine, version 3.0.1