A standard 4x4 transformation matrix.
A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear etc.) and perspective transformations using homogenous coordinates. You rarely use matrices in scripts; most often using Vector3s, Quaternions and functionality of Transform class is more straightforward. Plain matrices are used in special cases like setting up nonstandard camera projection.
Consult any graphics textbook for in depth explanation of transformation matrices.
Matrices in unity are column major. Data is accessed as: row + (column*4). Matrices can be indexed like 2D arrays but in an expression like mat[a, b], a refers to the row index, while b refers to the column index (note that this is the opposite way round to Cartesian coordinates).
|this [int row, int column]||
Access element at [row, column].
|this [int index]||
Access element at sequential index (0..15 inclusive).
The inverse of this matrix (Read Only).
Returns the transpose of this matrix (Read Only).
Is this the identity matrix?
Multiplies two matrices.
Get a column of the matrix.
Returns a row of the matrix.
Sets a column of the matrix.
Sets a row of the matrix.
Transforms a position by this matrix (generic).
Transforms a position by this matrix (fast).
Transforms a direction by this matrix.
Creates a scaling matrix.
Sets this matrix to a translation, rotation and scaling matrix.
Returns a nicely formatted string for this matrix.
Returns a matrix with all elements set to zero (Read Only).
Returns the identity matrix (Read Only).
Creates a translation, rotation and scaling matrix.
Creates an orthogonal projection matrix.
Creates a perspective projection matrix.