Matrix4x4
Operates as the cornerstone in modeling transformations in 3D space, holding critical data about translations, rotations, and scaling. Think of it as the mathematical blueprint that instructs your 3D objects on how to transform from one state to another – a fundamental tool in creating dynamic and interactive 3D environments. Like a guiding chart for your 3D objects, impacting how they move, turn, and resize in the 3D realm. Unity's Matrix4x4 Documentation
Properties
Determinant of the matrix. The determinant is a special number that encapsulates some properties of the matrix. It is used for solving systems of equations, in calculus, and more. Unity's Matrix4x4.determinant Documentation
Identity Matrix4x4. An identity matrix, when used to transform a point or a vector, leaves it unaltered, just like the number '1' in multiplication. It plays a crucial role in matrix operations and can be very useful for resetting transformations. Unity's Matrix4x4.identity Documentation
Inverse of the matrix, assuming it exists. An inverse matrix is a matrix that, when multiplied by the original matrix, yields the identity matrix. Unity's Matrix4x4.inverse Documentation
Boolean indicating whether the matrix is the identity matrix. The identity matrix is a special type of matrix that doesn't change any vector when we multiply that vector with it. Unity's Matrix4x4.isIdentity Documentation
Vector3 representing the scale of the matrix. If the matrix has a uniform scale (the same scale along all axes), 'lossyScale' will correctly report it. If the matrix has a non-uniform scale (different scales along different axes), 'lossyScale' will not accurately reflect it. Unity's Matrix4x4.lossyScale Documentation
Element at the first row and first column of the matrix. Unity's Matrix4x4.m00 Documentation
Element in the first row and second column of the matrix. Unity's Matrix4x4.m01 Documentation
Element at the first row and third column of the matrix. Unity's Matrix4x4.m02 Documentation
Element in the first row and fourth column of the matrix. Unity's Matrix4x4.m03 Documentation
Element at the second row and first column of the matrix. Unity's Matrix4x4.m10 Documentation
Element at the second row and second column of the matrix. Unity's Matrix4x4.m11 Documentation
Element in the second row and third column of the matrix. Unity's Matrix4x4.m12 Documentation
Element at the second row and fourth column of the matrix. Unity's Matrix4x4.m13 Documentation
Element in the third row and first column of the matrix. Unity's Matrix4x4.m20 Documentation
Element at the third row and second column of the matrix. Unity's Matrix4x4.m21 Documentation
Element in the third row and third column of the matrix. Unity's Matrix4x4.m22 Documentation
Element in the third row and fourth column of the matrix. Unity's Matrix4x4.m23 Documentation
Element at the fourth row and first column of the matrix. Unity's Matrix4x4.m30 Documentation
Element in the fourth row and second column of the matrix. Unity's Matrix4x4.m31 Documentation
Element at the fourth row and third column of the matrix. Unity's Matrix4x4.m32 Documentation
Element at the fourth row and fourth column of the matrix. Unity's Matrix4x4.m33 Documentation
Quaternion that represents the rotation part of this matrix. Accessing this property can be particularly useful if you want to extract the rotation information of a Matrix4x4 instance. Unity's Matrix4x4.rotation Documentation
Transpose of the matrix. The transpose of a matrix is obtained by swapping its rows with columns and vice versa. Unity's Matrix4x4.transpose Documentation
Matrix4x4 where all elements are set to zero. This essentially signifies a "null" transformation, meaning no change will take place on applying this matrix to a vector or a point. Unity's Matrix4x4.zero Documentation
Methods
Determinant of a given Matrix4x4. The determinant of a matrix is a special scalar value that can be computed from its elements and can provide useful information about the matrix. Unity's Matrix4x4.Determinant Documentation
Parameters
The matrix whose determinant is to be calculated.
Returns
Returns the determinant of the given matrix.
Checks if two Matrix4x4 matrices are equal, element-wise. Two matrices are considered equal if all their corresponding elements are equal. Unity's Matrix4x4.Equals Documentation
Parameters
other
Returns
Creates a perspective projection matrix that represents a view frustum. A frustum is a kind of pyramid with its top cut off. It is typically what a camera in 3D space sees with certain field of view and near and far clipping planes. Unity's Matrix4x4.Frustum Documentation
Parameters
left
The value for the left vertical clipping plane.
right
The value for the right vertical clipping plane.
bottom
The value for the bottom horizontal clipping plane.
top
The value for the top horizontal clipping plane.
zNear
The value for the near depth clipping plane.
zFar
The value for the far depth clipping plane.
Returns
Returns a perspective projection matrix that represents the specified view frustum.
Vector4 representing a specified column of the matrix. This can be helpful when you need to extract specific column information from a matrix. Unity's Matrix4x4.GetColumn Documentation
Parameters
index
The index of the column to retrieve.
Returns
Returns a Vector4 representing the specified column of the matrix.
Vector3 representing the position stored in the transformation matrix. This is particularly useful when wanting to extract the position component from a transformation matrix. Unity's Matrix4x4.GetPosition Documentation
Returns
Returns a Vector3 representing the position stored in the matrix.
Vector4 representing a specified row of the matrix. This can be useful when you need to extract certain row information from a matrix. Unity's Matrix4x4.GetRow Documentation
Parameters
index
The index of the row to retrieve.
Returns
Returns a Vector4 representing the specified row of the matrix.
Computes the inverse of a given Matrix4x4. The inverse of a matrix is a matrix that, when multiplied with the original matrix, yields the identity matrix. Unity's Matrix4x4.Inverse Documentation
Creates a viewing matrix aimed at a target with a defined up direction. This method can be useful in a variety of situations, like setting the view matrix of a camera. Unity's Matrix4x4.LookAt Documentation
Parameters
Returns
Returns a viewing matrix aimed at the target from a set position and up direction.
Multiplies a Matrix4x4 and a Vector3 together. It treats the input Vector3 as a point in 3D space - this means it also considers the translation stored in the matrix. Unity's Matrix4x4.MultiplyPoint Documentation
Multiplies a Matrix4x4 and a Vector3 together. It treats the matrix as if it's a 3x4 matrix, and thus the result will not have perspective projection applied. Unity's Matrix4x4.MultiplyPoint3x4 Documentation
Multiplies a Matrix4x4 and a Vector3 together. It treats the input Vector3 as a direction rather than a point, meaning it will not consider the translation part of the matrix. Unity's Matrix4x4.MultiplyVector Documentation
Creates an orthogonal projection matrix. The resulting matrix can be used to transform coordinates in 3D into a 2D projection. This is particularly useful in things like 2D games or interfaces. Unity's Matrix4x4.Ortho Documentation
Parameters
left
The value for the left vertical clipping plane.
right
The value for the right vertical clipping plane.
bottom
The value for the bottom horizontal clipping plane.
top
The value for the top horizontal clipping plane.
zNear
The value for the near depth clipping plane.
zFar
The value for the far depth clipping plane.
Returns
Returns an orthogonal projection matrix created from the specified parameters.
Creates a perspective projection matrix from field of view, aspect ratio, and near and far clipping planes. The resulting matrix can be used to transform 3D coordinates into a 2D perspective. Unity's Matrix4x4.Perspective Documentation
Parameters
fov
The field of view in the y direction, measured in degrees.
aspect
The aspect ratio, defined as width divided by height.
zNear
The value for the near depth clipping plane.
zFar
The value for the far depth clipping plane.
Returns
Returns a perspective projection matrix created from the specified parameters.
Creates a rotation matrix from a Quaternion. The resulting matrix can be used to rotate an object in 3D space by the specified Quaternion. Unity's Matrix4x4.Rotate Documentation
Parameters
The quaternion by which to rotate.
Returns
Returns a rotation matrix created from the specified quaternion.
Creates a scaling matrix from a given Vector3. The resulting matrix can be used to scale an object in 3D space by the specified vector. Unity's Matrix4x4.Scale Documentation
Vector4 to a specified column of the matrix. This method comes in handy when you want to replace a specific column of a matrix. Unity's Matrix4x4.SetColumn Documentation
Parameters
index
The index of the column to set.
column
The vector to set in the specified column of the matrix.
Returns
Vector4 to a specified row of the matrix. You can use this method to replace a certain row of a matrix. Unity's Matrix4x4.SetRow Documentation
Parameters
index
The index of the row to set.
row
The vector to set in the specified row of the matrix.
Returns
Sets the matrix to a transformation matrix, given a Vector3 for position, a Quaternion for rotation, and a Vector3 for scale. It's quick and convenient when you want to set up a transform from position, rotation and scale values. Unity's Matrix4x4.SetTRS Documentation
Parameters
pos
The position to set in the transformation matrix.
The rotation to set in the transformation matrix
The scale to set in the transformation matrix.
Returns
Creates a transformation matrix from translation, rotation, and scale. The 'TRS' stands for 'Translate, Rotate, Scale'. It returns a Matrix4x4 built from the given Vector3 of position, Quaternion of rotation and another Vector3 of scale. Unity's Matrix4x4.TRS Documentation
Parameters
pos
The position to be included in the transformation matrix.
The rotation to be included in the transformation matrix.
The scale to be included in the transformation matrix.
Returns
Returns a Matrix4x4 transformation matrix created from a position, rotation, and scale.
Creates a translation matrix from a given Vector3. It can be used to move an object in 3D space by a specified vector. Unity's Matrix4x4.Translate Documentation
Creates the transpose of a given Matrix4x4. The transpose of a matrix is a new matrix whose rows are the columns of the original matrix and whose columns are the original's rows. Unity's Matrix4x4.Transpose Documentation
Checks if a matrix is a valid transformation matrix. It returns a boolean indicating whether the matrix holds valid translation, rotation, and scale values. Unity's Matrix4x4.ValidTRS Documentation
Returns
Returns true if the matrix is a valid transformation matrix, otherwise false.
Updated 12 days ago