Class sandy.math.Matrix4Math

Description

Math functions for Matrix4.

Method Index

addMatrix(), axisRotation(), axisRotationVector(), axisRotationWithReference(), clone(), det(), det3x3(), eulerRotation(), getInverse(), getTrace(), multiply(), multiply3x3(), multiply4x3(), projectVector(), rotationX(), rotationY(), rotationZ(), scale(), scaleVector(), translation(), translationVector(), vectorMult(), vectorMult3x3()

Method Detail

multiply3x3

static public function multiply3x3(m1:Matrix4, m2:Matrix4):Matrix4

Compute the multiplication of 2 Matrix4 but as they were 3x3 matrix.

Parameters

Return

The result of computation : a Matrix4.

multiply4x3

static public function multiply4x3(m1:Matrix4, m2:Matrix4):Matrix4

multiply

static public function multiply(m1:Matrix4, m2:Matrix4):Matrix4

Compute the multiplication of 2 Matrix4.

Parameters

Return

The result of computation : a Matrix4.

addMatrix

static public function addMatrix(m1:Matrix4, m2:Matrix4):Matrix4

Compute an addition Matrix4.

Parameters

Return

The result of computation : a Matrix4.

clone

static public function clone(m:Matrix4):Matrix4

Compute a clonage Matrix4.

Parameters

Return

The result of clonage : a Matrix4.

vectorMult

static public function vectorMult(m:Matrix4, v:Vector):Void

Compute a multiplication of a vertex and the matrix Matrix4.

Parameters

Return

Void

vectorMult3x3

static public function vectorMult3x3(m:Matrix4, v:Vector):Void

Compute a multiplication of a vector and the matrix Matrix4 as there were of 3 dimensions.

Parameters

Return

Void

projectVector

static public function projectVector(mp:Matrix4, v:Vector):Void

Compute the projection of a vector with a projection matrix. The result gives a 2 dimension point represented by the x and y properties of the vector (z is null). Be carefull: The passed matrix MUST be a PROJECTION matrix.

Parameters

mpMAtrix4 The projection matrix which will project the point from a 3D space to a 2D space.
vThe vector to project. Properties will be modified!

eulerRotation

static public function eulerRotation(ax:Number, ay:Number, az:Number):Matrix4

Compute a Rotation Matrix4 from the Euler angle in degrees unit.

Parameters

Return

The result of computation : a Matrix4.

rotationX

static public function rotationX(angle:Number):Matrix4

Parameters

angleNumber angle of rotation in degrees

Return

the computed matrix

rotationY

static public function rotationY(angle:Number):Matrix4

Parameters

angleNumber angle of rotation in degrees

Return

the computed matrix

rotationZ

static public function rotationZ(angle:Number):Matrix4

Parameters

angleNumber angle of rotation in degrees

Return

the computed matrix

axisRotationVector

static public function axisRotationVector(v:Vector, angle:Number):Matrix4

Compute a Rotation around a Vector which represents the axis of rotation Matrix4.

Parameters

Return

The result of computation : a Matrix4.

axisRotation

static public function axisRotation(u:Number, v:Number, w:Number, angle:Number):Matrix4

Compute a Rotation around an axis Matrix4.

Parameters

Return

The result of computation : a Matrix4.

translation

static public function translation(nTx:Number, nTy:Number, nTz:Number):Matrix4

Compute a translation Matrix4.

 |1  0  0  0|
 |0  1  0  0|
 |0  0  1  0|
 |Tx Ty Tz 1|
 

Parameters

Return

The result of computation : a Matrix4.

translationVector

static public function translationVector(v:Vector):Matrix4

Compute a translation from a vector Matrix4.

 |1  0  0  0|
 |0  1  0  0|
 |0  0  1  0|
 |Tx Ty Tz 1|
 

Parameters

scale

static public function scale(nXScale:Number, nYScale:Number, nZScale:Number):Matrix4

Compute a scale Matrix4.

 |Sx 0  0  0|
 |0  Sy 0  0|
 |0  0  Sz 0|
 |0  0  0  1|
 

Parameters

Return

The result of computation : a Matrix.

scaleVector

static public function scaleVector(v:Vector):Matrix4

Compute a scale Matrix4.

 |Sx 0  0  0|
 |0  Sy 0  0|
 |0  0  Sz 0|
 |0  0  0  1|
 

Parameters

Return

The result of computation : a Matrix.

det

static public function det(m:Matrix4):Number

Compute the determinant of the 4x4 square matrix

Parameters

ma Matrix4

Return

Number the determinant

det3x3

static public function det3x3(m:Matrix4):Number

getTrace

static public function getTrace(m:Matrix4):Number

Computes the trace of the matrix.

Parameters

mMatrix4 The matrix we want to compute the trace

Return

The trace value which is the sum of the element on the diagonal

getInverse

static public function getInverse(m:Matrix4):Matrix4

Return the inverse of the matrix passed in parameter.

Parameters

mThe matrix4 to inverse

Return

Matrix4 The inverse Matrix4

axisRotationWithReference

static public function axisRotationWithReference(axis:Vector, ref:Vector, pAngle:Number):Matrix4

Realize a rotation around a specific axis (the axis must be normalized!) and from an pangle degrees and around a specific position.

Parameters

refVector The center of rotation as a 3D point.
pAngleNumber The angle of rotation in degrees.