Matrix manipulation.
More...
|
| array | Create () |
| | Creates a 4x4 matrix and sets it to the identity.
|
| void | Identity (matrix matrix) |
| | Sets the matrix to the identity.
|
| void | Perspective (matrix matrix, number fov, number near, number far, number aspect) |
| | Creates a perspective projection matrix.
|
| void | Copy (matrix matrixDestination, matrix matrixSource) |
| | Copies the matrix to the destination.
|
| void | Multiply (matrix matrix, matrix a, matrix b) |
| | Multiplies two matrices.
|
| void | Translate (matrix matrix, number x, number y, number z, boolean resetToIdentity=false, boolean actuallyTranslate=false) |
| | Translates the matrix.
|
| void | Scale (matrix matrix, number x, number y, number z) |
| | Sets the matrix to a scale identity.
|
| void | Rotate (matrix matrix, number x, number y, number z) |
| | Sets the matrix to a rotation identity.
|
◆ Copy()
| void Matrix.Copy |
( |
matrix | matrixDestination, |
|
|
matrix | matrixSource ) |
Copies the matrix to the destination.
- Parameters
-
| matrixDestination | Destination. |
| matrixSource | Source. |
◆ Create()
Creates a 4x4 matrix and sets it to the identity.
"The model, view and projection matrices are three separate matrices. <br/>Model maps from an object's local coordinate space into world space, <br/>view from world space to view space, projection from camera to screen.<br/><br/>If you compose all three, you can use the one result to map all the way from <br/>object space to screen space, making you able to work out what you need to <br/>pass on to the next stage of a programmable pipeline from the incoming <br/>vertex positions." - Tommy (https://stackoverflow.com/questions/5550620/the-purpose-of-model-view-projection-matrix)
- Returns
- Returns the matrix as an array.
◆ Identity()
| void Matrix.Identity |
( |
matrix | matrix | ) |
|
Sets the matrix to the identity.
- Parameters
-
| matrix | The matrix to set to the identity. |
◆ Multiply()
| void Matrix.Multiply |
( |
matrix | matrix, |
|
|
matrix | a, |
|
|
matrix | b ) |
Multiplies two matrices.
- Parameters
-
| matrix | The matrix to output the values to. |
| a | The first matrix to use for multiplying. |
| b | The second matrix to use for multiplying. |
◆ Perspective()
| void Matrix.Perspective |
( |
matrix | matrix, |
|
|
number | fov, |
|
|
number | near, |
|
|
number | far, |
|
|
number | aspect ) |
Creates a perspective projection matrix.
- Parameters
-
| matrix | The matrix to generate the projection matrix into. |
| fov | The field of view, in degrees. |
| near | The near clipping plane value. |
| far | The far clipping plane value. |
| aspect | The aspect ratio. |
◆ Rotate()
| void Matrix.Rotate |
( |
matrix | matrix, |
|
|
number | x, |
|
|
number | y, |
|
|
number | z ) |
Sets the matrix to a rotation identity.
- Parameters
-
| matrix | The matrix to output the values to. |
| x | X rotation value. |
| y | Y rotation value. |
| z | Z rotation value. |
◆ Scale()
| void Matrix.Scale |
( |
matrix | matrix, |
|
|
number | x, |
|
|
number | y, |
|
|
number | z ) |
Sets the matrix to a scale identity.
- Parameters
-
| matrix | The matrix to output the values to. |
| x | X scale value. |
| y | Y scale value. |
| z | Z scale value. |
◆ Translate()
| void Matrix.Translate |
( |
matrix | matrix, |
|
|
number | x, |
|
|
number | y, |
|
|
number | z, |
|
|
boolean | resetToIdentity = false, |
|
|
boolean | actuallyTranslate = false ) |
Translates the matrix.
- Parameters
-
| matrix | The matrix to output the values to. |
| x | X position value. |
| y | Y position value. |
| z | Z position value. |
| resetToIdentity | Whether to calculate the translation values based on the matrix. |
| actuallyTranslate | Adds the translation components to the matrix instead of overwriting them (Preserves older code functionality, please fix me!). |