matrixΒΆ
class matrix
A 4x4 transformation matrix
Members
| create | ( ) | Create an unitilialised matrix. |
| create | (
|
Create an identity matrix if identity parameter is true. |
| create | (
|
Create a copy of the input matrix |
| create | (
|
Create a matrix from an array of 16 numbers |
| create | (
|
Create a matrix from 16 numbers |
| * | (
|
Returns self*other |
| + | (
|
Returns self+other |
| - | (
|
Returns self-other |
| asarray | ( ) | Converts the matrix as an array table of 16 numbers |
| compose | (
|
Returns the composition of the two matrices |
| copy | (
|
Copy the source matrix into this matrix |
| decompose | ( ) | Decompose the matrix into scale, rotation and translation components. |
| equals | (
|
Compares this matrix to other matrix. |
| geti | ( ) | Return the i direction of the matrix. |
| getinverted | ( ) | Return the inverted matrix. |
| getj | ( ) | Return the j direction of the matrix. |
| getk | ( ) | Return the k direction of the matrix. |
| gettranslation | ( ) | Return the translation of the matrix. |
| gettransposed | ( ) | Return the transposed matrix. |
| lookat | (
|
Set the matrix to look from position to target with up as roll. |
| normalize | ( ) | Normalize the line components of the matrix. |
| pivot | (
|
Rotate this matrix around around a pivot, an axis and an angle in radian |
| rotate | (
|
Rotate the matrix around an axis with an angle in radian |
| rotatex | (
|
Rotate the matrix around the x axis. |
| rotatey | (
|
Rotate the matrix around the y axis. |
| rotatez | (
|
Rotate the matrix around the z axis. |
| scale | (
|
Scale the matrix on all axises. |
| serialstring | ( ) | Returns a Lua evaluable string to create this object |
| seti | (
|
Set the i direction of the matrix. |
| setidentity | ( ) | Set the matrix to identity. |
| setj | (
|
Set the j direction of the matrix. |
| setk | (
|
Set the k direction of the matrix. |
| settranslation | (
|
Set the translation of the matrix. |
| toboots | ( ) | Returns the boots code for this matrix. |
| transform | (
|
Return the transform of the point p by the matrix. (p * self) |
| translate | (
|
Translate the matrix. |
| vtransform | (
|
Return the transform of the vector p by the matrix. (v * self) |
| createcomposite | (
|
Create the composite matrix using scale, rotation and translation. The scale factors are first applied, then x rotation, y rotation and z rotation, and the the translation is applied. |
| createfromarray | (
|
Create a new matrix object from a array table of numbers |
| createidentity | ( ) | |
| createlookat | (
|
Compute a lookat matrix. pos and target must be specified. rool OR up can be specified. |
| fromarray | (
|
Create a new matrix object from a array table of numbers |
Documentation
Returns self*other
other
result
Returns self+other
other
result
Returns self-other
other
result
Converts the matrix as an array table of 16 numbers
result The corresponding array of numbers
Returns the composition of the two matrices
other
result
Copy the source matrix into this matrix
source The matrix to copy
Decompose the matrix into scale, rotation and translation components.
sx,sy,sz,rx,ry,rz,tx,ty,tz The decomposed matrix components
Compares this matrix to other matrix.
other
isequal True if all values of the matrices are equal
Return the i direction of the matrix.
result
Return the inverted matrix.
result
Return the j direction of the matrix.
result
Return the k direction of the matrix.
result
Return the translation of the matrix.
result
Return the transposed matrix.
result
Set the matrix to look from position to target with up as roll.
position The viewing positiontarget The target positionup The up vectory
Normalize the line components of the matrix.
Rotate this matrix around around a pivot, an axis and an angle in radian
axis The rotation axisangle The rotation angle in radianpivot The rotation pivot
Rotate the matrix around an axis with an angle in radian
axis The rotation axisangle The rotation angle
Rotate the matrix around the x axis.
angle The rotation angle in radians
Rotate the matrix around the y axis.
angle The rotation angle in radians
Rotate the matrix around the z axis.
angle The rotation angle in radians
Scale the matrix on all axises.
scalex The scale factor on x axisscaley The scale factor on y axisscalez The scale factor on z axis
Returns a Lua evaluable string to create this object
Set the i direction of the matrix.
newi
Set the matrix to identity.
Set the j direction of the matrix.
newj
Set the k direction of the matrix.
newk
Set the translation of the matrix.
newt
Returns the boots code for this matrix.
boots
Return the transform of the point p by the matrix. (p * self)
p
result
Translate the matrix.
translation The translation vector
Return the transform of the vector p by the matrix. (v * self)
v
result
Create the composite matrix using scale, rotation and translation. The scale factors are first applied, then x rotation, y rotation and z rotation, and the the translation is applied.
sx The x scalesy The y scalesz The z scalerx The x rotation angle in radianry The y rotation angle in radianrz The z rotation angle in radiantx The x translationty The y translationtz The z translation
result
Create a new matrix object from a array table of numbers
array The source array table of numbers
result The new matrix object
result A new matrix set to identity
Compute a lookat matrix. pos and target must be specified. rool OR up can be specified.
pos The positiontarget The position to aimroll The roll angle in radian or nilup The up vector or nildirection The lookup direction. Can be nil, "z" or "-z". Default is "z".
result The lookup matrix
Create a new matrix object from a array table of numbers
array The source array table of numbers
result The new matrix object