| Package | org.flintparticles.threeD.geom |
| Class | public class Matrix3D |
Matrix3D represents a 3D transformation matrix. It mimics some aspects of the flash.geom.Matrix3D class embedded in the Flash Player version 10.
| Property | Defined by | ||
|---|---|---|---|
| determinant : Number [read-only]
The determinant of the matrix
| Matrix3D | ||
| inverse : Matrix3D
[read-only]
The inverse of this matrix, or null if no inverse exists
| Matrix3D | ||
| n11 : Number
The value in row 1 column 1 of the matrix.
| Matrix3D | ||
| n12 : Number
The value in row 1 column 2 of the matrix.
| Matrix3D | ||
| n13 : Number
The value in row 1 column 3 of the matrix.
| Matrix3D | ||
| n14 : Number
The value in row 1 column 4 of the matrix.
| Matrix3D | ||
| n21 : Number
The value in row 2 column 1 of the matrix.
| Matrix3D | ||
| n22 : Number
The value in row 2 column 2 of the matrix.
| Matrix3D | ||
| n23 : Number
The value in row 2 column 3 of the matrix.
| Matrix3D | ||
| n24 : Number
The value in row 2 column 4 of the matrix.
| Matrix3D | ||
| n31 : Number
The value in row 3 column 1 of the matrix.
| Matrix3D | ||
| n32 : Number
The value in row 3 column 2 of the matrix.
| Matrix3D | ||
| n33 : Number
The value in row 3 column 3 of the matrix.
| Matrix3D | ||
| n34 : Number
The value in row 3 column 4 of the matrix.
| Matrix3D | ||
| n41 : Number
The value in row 4 column 1 of the matrix.
| Matrix3D | ||
| n42 : Number
The value in row 4 column 2 of the matrix.
| Matrix3D | ||
| n43 : Number
The value in row 4 column 3 of the matrix.
| Matrix3D | ||
| n44 : Number
The value in row 4 column 4 of the matrix.
| Matrix3D | ||
| position : Point3D
The positionelements of the matrix.
| Matrix3D | ||
| rawData : Array
An array containing the sixteen values in the matrix, in row-major form.
| Matrix3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
Matrix3D(values:Array = null)
Creates a Matrix3D object from an array of numbers.
| Matrix3D | ||
|
Add another transformation matrix to this one, applying the new
transformation after the transformations already in this matrix.
| Matrix3D | ||
|
Append a coordinate system transformation such that the vectors
indicated are transformed to the x, y and z axes.
| Matrix3D | ||
|
Append a rotation about an axis transformation to this matrix, applying the
rotation after the transformations already in this matrix.
| Matrix3D | ||
|
appendScale(scaleX:Number, scaleY:Number, scaleZ:Number):Matrix3D
Append a scale transformation to this matrix, applying the scale
after the transformations already in this matrix.
| Matrix3D | ||
|
appendTranslate(x:Number, y:Number, z:Number):Matrix3D
Append a translation transformation to this matrix, applying the
translation after the transformations already in this matrix.
| Matrix3D | ||
|
Make a duplicate of this matrix
| Matrix3D | ||
|
Copy another matrix into this one
| Matrix3D | ||
|
Compare another matrix with this one
| Matrix3D | ||
|
Invert this matrix.
| Matrix3D | ||
|
nearEquals(m:Matrix3D, e:Number):Boolean
Compare another matrix with this one
| Matrix3D | ||
|
[static]
Creates a coordinate system transformation such that the vectors
indicated are transformed to the x, y and z axes.
| Matrix3D | ||
|
[static]
Creates a new Matrix3D for rotation about an axis.
| Matrix3D | ||
|
[static]
Creates a new Matrix3D for scaling.
| Matrix3D | ||
|
newTranslate(x:Number, y:Number, z:Number):Matrix3D
[static]
Creates a new Matrix3D for translation.
| Matrix3D | ||
|
Add another transformation matrix to this one, applying the new
transformation before the transformations already in this matrix.
| Matrix3D | ||
|
Prepend a coordinate system transformation such that the vectors
indicated are transformed to the x, y and z axes.
| Matrix3D | ||
|
Prepend a rotation about an axis transformation to this matrix, applying the
rotation before the transformations already in this matrix.
| Matrix3D | ||
|
prependScale(scaleX:Number, scaleY:Number, scaleZ:Number):Matrix3D
Prepend a scale transformation to this matrix, applying the scale
before the transformations already in this matrix.
| Matrix3D | ||
|
prependTranslate(x:Number, y:Number, z:Number):Matrix3D
Prepend a translation transformation to this matrix, applying the
translation before the transformations already in this matrix.
| Matrix3D | ||
|
toString():String
| Matrix3D | ||
|
transform(v:Transformable3D, result:Transformable3D = null):Transformable3D
Transform a Vector3D or Point3D using this matrix, returning a new, transformed vector.
| Matrix3D | ||
|
transformArray(vectors:Array):Array
Transform an array of Vector3D or Point3D objects using this matrix.
| Matrix3D | ||
|
transformArraySelf(vectors:Array):Array
Transform an array of Vector3D or Point3D objects using this matrix.
| Matrix3D | ||
|
transformSelf(v:Transformable3D):Transformable3D
Transform a Vector3D or Point3D using this matrix, storing the result in the original
vector.
| Matrix3D | ||
| Constant | Defined by | ||
|---|---|---|---|
| IDENTITY : Matrix3D
[static]
An identity matrix.
| Matrix3D | ||
| ZERO : Matrix3D
[static]
A zero matrix.
| Matrix3D | ||
| determinant | property |
determinant:Number [read-only]The determinant of the matrix
Implementation public function get determinant():Number
| inverse | property |
inverse:Matrix3D [read-only]The inverse of this matrix, or null if no inverse exists
Implementation public function get inverse():Matrix3D
| n11 | property |
public var n11:NumberThe value in row 1 column 1 of the matrix. x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| n12 | property |
public var n12:NumberThe value in row 1 column 2 of the matrix. 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| n13 | property |
public var n13:NumberThe value in row 1 column 3 of the matrix. 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0
| n14 | property |
public var n14:NumberThe value in row 1 column 4 of the matrix. 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0 0
| n21 | property |
public var n21:NumberThe value in row 2 column 1 of the matrix. 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0 0
| n22 | property |
public var n22:NumberThe value in row 2 column 2 of the matrix. 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 0
| n23 | property |
public var n23:NumberThe value in row 2 column 3 of the matrix. 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0
| n24 | property |
public var n24:NumberThe value in row 2 column 4 of the matrix. 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0
| n31 | property |
public var n31:NumberThe value in row 3 column 1 of the matrix. 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0
| n32 | property |
public var n32:NumberThe value in row 3 column 2 of the matrix. 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0
| n33 | property |
public var n33:NumberThe value in row 3 column 3 of the matrix. 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0
| n34 | property |
public var n34:NumberThe value in row 3 column 4 of the matrix. 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0
| n41 | property |
public var n41:NumberThe value in row 4 column 1 of the matrix. 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0
| n42 | property |
public var n42:NumberThe value in row 4 column 2 of the matrix. 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 0
| n43 | property |
public var n43:NumberThe value in row 4 column 3 of the matrix. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0
| n44 | property |
public var n44:NumberThe value in row 4 column 4 of the matrix. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x
| position | property |
position:Point3D [read-write]The positionelements of the matrix. This is the last column of the matrix, containing values n14, n24, n34, n44.
Implementation public function get position():Point3D
public function set position(value:Point3D):void
| rawData | property |
rawData:Array [read-write]An array containing the sixteen values in the matrix, in row-major form.
[n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44]
Implementation public function get rawData():Array
public function set rawData(value:Array):void
| Matrix3D | () | constructor |
public function Matrix3D(values:Array = null)Creates a Matrix3D object from an array of numbers.
The array may contain 12 or 16 numbers in row major form. If the array contains only 12 values, the values 0,0,0,1 are used to populate the last row of the matrix. If no array is passed in, an identity matrix is created.
Parametersvalues:Array (default = null) — The raw data to populate the matrix with.
|
| append | () | method |
public function append(m:Matrix3D):Matrix3DAdd another transformation matrix to this one, applying the new transformation after the transformations already in this matrix.
Parametersm:Matrix3D — The other transformation matrix
|
Matrix3D —
A reference to this matrix
|
| appendBasisTransform | () | method |
public function appendBasisTransform(axisX:Vector3D, axisY:Vector3D, axisZ:Vector3D):Matrix3DAppend a coordinate system transformation such that the vectors indicated are transformed to the x, y and z axes. The vectors need not be perpendicular, but they must form a basis for 3D space.
ParametersaxisX:Vector3D — The vector that is translated to ( 1, 0, 0 ) by the transform.
|
|
axisY:Vector3D — The vector that is translated to ( 0, 1, 0 ) by the transform.
|
|
axisZ:Vector3D — The vector that is translated to ( 0, 0, 1 ) by the transform.
|
Matrix3D —
A reference to this matrix
|
| appendRotate | () | method |
public function appendRotate(angle:Number, axis:Vector3D, pivotPoint:Point3D = null):Matrix3DAppend a rotation about an axis transformation to this matrix, applying the rotation after the transformations already in this matrix.
Parametersangle:Number — The rotation angle in radians. If this is not set, the
w coordinate of the axis is used as the angle.
|
|
axis:Vector3D — The vector to rotate around
|
|
pivotPoint:Point3D (default = null) — The point the axis passes through. The default value is the origin.
|
Matrix3D —
A reference to this matrix
|
| appendScale | () | method |
public function appendScale(scaleX:Number, scaleY:Number, scaleZ:Number):Matrix3DAppend a scale transformation to this matrix, applying the scale after the transformations already in this matrix.
ParametersscaleX:Number — The scaling factor in the x direction
|
|
scaleY:Number — The scaling factor in the y direction
|
|
scaleZ:Number — The scaling factor in the z direction
|
Matrix3D —
A reference to this matrix
|
| appendTranslate | () | method |
public function appendTranslate(x:Number, y:Number, z:Number):Matrix3DAppend a translation transformation to this matrix, applying the translation after the transformations already in this matrix.
Parametersx:Number — The translation along the x axis.
|
|
y:Number — The translation along the y axis.
|
|
z:Number — The translation along the z axis.
|
Matrix3D —
A reference to this matrix
|
| clone | () | method |
| copy | () | method |
public function copy(m:Matrix3D):Matrix3DCopy another matrix into this one
Parametersm:Matrix3D — the matrix to copy
|
Matrix3D —
a reference to this matrix
|
| equals | () | method |
public function equals(m:Matrix3D):BooleanCompare another matrix with this one
Parametersm:Matrix3D — the matrix to compare with
|
Boolean — true if the matrices are the same, false otherwise
|
| invert | () | method |
public function invert():Matrix3DInvert this matrix. If no inverse exists, the matrix is invalid and null is returned.
ReturnsMatrix3D —
A reference to this matrix or null if no inverse exists
|
| nearEquals | () | method |
public function nearEquals(m:Matrix3D, e:Number):BooleanCompare another matrix with this one
Parametersm:Matrix3D — the matrix to compare with
|
|
e:Number — The small variation allowed between the values representing
the matrices
|
Boolean — true if the matrices are the within e of each other, false otherwise
|
| newBasisTransform | () | method |
public static function newBasisTransform(axisX:Vector3D, axisY:Vector3D, axisZ:Vector3D):Matrix3DCreates a coordinate system transformation such that the vectors indicated are transformed to the x, y and z axes. The vectors need not be perpendicular, but they must form a basis for 3D space.
ParametersaxisX:Vector3D — The vector that is translated to ( 1, 0, 0 ) by the transform.
|
|
axisY:Vector3D — The vector that is translated to ( 0, 1, 0 ) by the transform.
|
|
axisZ:Vector3D — The vector that is translated to ( 0, 0, 1 ) by the transform.
|
Matrix3D |
| newRotate | () | method |
public static function newRotate(angle:Number, axis:Vector3D, pivotPoint:Point3D = null):Matrix3DCreates a new Matrix3D for rotation about an axis.
Parametersangle:Number — The angle in radians for the rotation
|
|
axis:Vector3D — The axis to rotate around
|
|
pivotPoint:Point3D (default = null) — The point the axis passes through. The default value is the origin.
|
Matrix3D —
The new matrix
|
| newScale | () | method |
public static function newScale(scaleX:Number, scaleY:Number, scaleZ:Number):Matrix3DCreates a new Matrix3D for scaling.
ParametersscaleX:Number — The scale factor in the x direction
|
|
scaleY:Number — The scale factor in the y direction
|
|
scaleZ:Number — The scale factor in the z direction
|
Matrix3D —
The new matrix
|
| newTranslate | () | method |
public static function newTranslate(x:Number, y:Number, z:Number):Matrix3DCreates a new Matrix3D for translation.
Parametersx:Number — The translation along the x axis.
|
|
y:Number — The translation along the y axis.
|
|
z:Number — The translation along the z axis.
|
Matrix3D —
The new matrix
|
| prepend | () | method |
public function prepend(m:Matrix3D):Matrix3DAdd another transformation matrix to this one, applying the new transformation before the transformations already in this matrix.
Parametersm:Matrix3D — The other transformation matrix
|
Matrix3D —
A reference to this matrix
|
| prependBasisTransform | () | method |
public function prependBasisTransform(axisX:Vector3D, axisY:Vector3D, axisZ:Vector3D):Matrix3DPrepend a coordinate system transformation such that the vectors indicated are transformed to the x, y and z axes. The vectors need not be perpendicular, but they must form a basis for 3D space.
ParametersaxisX:Vector3D — The vector that is translated to ( 1, 0, 0 ) by the transform.
|
|
axisY:Vector3D — The vector that is translated to ( 0, 1, 0 ) by the transform.
|
|
axisZ:Vector3D — The vector that is translated to ( 0, 0, 1 ) by the transform.
|
Matrix3D —
A reference to this matrix
|
| prependRotate | () | method |
public function prependRotate(angle:Number, axis:Vector3D, pivotPoint:Point3D = null):Matrix3DPrepend a rotation about an axis transformation to this matrix, applying the rotation before the transformations already in this matrix.
Parametersangle:Number — The rotation angle in radians. If this is not set, the
w coordinate of the axis is used as the angle.
|
|
axis:Vector3D — The vector to rotate around
|
|
pivotPoint:Point3D (default = null) — The point the axis passes through. The default value is the origin.
|
Matrix3D —
A reference to this matrix
|
| prependScale | () | method |
public function prependScale(scaleX:Number, scaleY:Number, scaleZ:Number):Matrix3DPrepend a scale transformation to this matrix, applying the scale before the transformations already in this matrix.
ParametersscaleX:Number — The scaling factor in the x direction
|
|
scaleY:Number — The scaling factor in the y direction
|
|
scaleZ:Number — The scaling factor in the z direction
|
Matrix3D —
A reference to this matrix
|
| prependTranslate | () | method |
public function prependTranslate(x:Number, y:Number, z:Number):Matrix3DPrepend a translation transformation to this matrix, applying the translation before the transformations already in this matrix.
Parametersx:Number — The translation along the x axis.
|
|
y:Number — The translation along the y axis.
|
|
z:Number — The translation along the z axis.
|
Matrix3D —
A reference to this matrix
|
| toString | () | method |
public function toString():String
Returns
String |
| transform | () | method |
public function transform(v:Transformable3D, result:Transformable3D = null):Transformable3DTransform a Vector3D or Point3D using this matrix, returning a new, transformed vector.
Parametersv:Transformable3D — The vector to transform.
|
|
result:Transformable3D (default = null) |
Transformable3D — The result of the transformation.
|
| transformArray | () | method |
public function transformArray(vectors:Array):ArrayTransform an array of Vector3D or Point3D objects using this matrix. The results are returned in a new array.
Parametersvectors:Array — the array of Vector3D or Point3D objects to transform.
|
Array — An array containing the new transformed vectors.
|
| transformArraySelf | () | method |
public function transformArraySelf(vectors:Array):ArrayTransform an array of Vector3D or Point3D objects using this matrix. The original vectors are modified to contain the new, transformed values.
Parametersvectors:Array — the array of Vector3D or Point3D objects to transform.
|
Array — The original array, which now contains the transformed vectors.
|
| transformSelf | () | method |
public function transformSelf(v:Transformable3D):Transformable3DTransform a Vector3D or Point3D using this matrix, storing the result in the original vector.
Parametersv:Transformable3D — The vector to transform.
|
Transformable3D — A reference to the original (now transformed) vector.
|
| IDENTITY | constant |
public static const IDENTITY:Matrix3DAn identity matrix.
| ZERO | constant |
public static const ZERO:Matrix3DA zero matrix.