Class CoreMatrixUtils
Set of utility functions for the Core Scriptable Render Pipeline Library related to Matrix operations
Namespace: UnityEngine.Rendering
Syntax
public static class CoreMatrixUtils
Methods
MatrixTimesTranslation(ref Matrix4x4, Vector3)
This function provides the equivalent of multiplying matrix parameter inOutMatrix with a translation matrix defined by the parameter translation. The order of the equivalent multiplication is inOutMatrix * translation.
Declaration
public static void MatrixTimesTranslation(ref Matrix4x4 inOutMatrix, Vector3 translation)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | inOutMatrix | Matrix to multiply with translation. |
Vector3 | translation | Translation component to multiply to the matrix. |
MultiplyOrthoMatrix(Matrix4x4, Matrix4x4, Boolean)
Multiplies a matrix with an orthographic matrix. This function is faster than performing the full matrix multiplication. The operation order is ortho * rhs.
Declaration
public static Matrix4x4 MultiplyOrthoMatrix(Matrix4x4 ortho, Matrix4x4 rhs, bool centered)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | ortho | The ortho matrix to multiply with rhs. |
Matrix4x4 | rhs | A matrix to be multiply to perspective. |
Boolean | centered | If true, it means that right and left are equivalently distant from center and similarly top/bottom are equivalently distant from center. |
Returns
Type | Description |
---|---|
Matrix4x4 | Returns the matrix that is the result of the multiplication. |
MultiplyPerspectiveMatrix(Matrix4x4, Matrix4x4)
Multiplies a matrix with a perspective matrix. This function is faster than performing the full matrix multiplication. The operation order is perspective * rhs.
Declaration
public static Matrix4x4 MultiplyPerspectiveMatrix(Matrix4x4 perspective, Matrix4x4 rhs)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | perspective | The perspective matrix to multiply with rhs. |
Matrix4x4 | rhs | A matrix to be multiply to perspective. |
Returns
Type | Description |
---|---|
Matrix4x4 | Returns the matrix that is the result of the multiplication. |
MultiplyProjectionMatrix(Matrix4x4, Matrix4x4, Boolean)
Multiplies a matrix with a projection matrix. This function is faster than performing the full matrix multiplication. The operation order is projMatrix * rhs.
Declaration
public static Matrix4x4 MultiplyProjectionMatrix(Matrix4x4 projMatrix, Matrix4x4 rhs, bool orthoCentered)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | projMatrix | The projection matrix to multiply with rhs. |
Matrix4x4 | rhs | A matrix to be multiply to perspective. |
Boolean | orthoCentered | If true, the projection matrix is a centered ( right+left == top+bottom == 0) orthographic projection, otherwise it is a perspective matrix.. |
Returns
Type | Description |
---|---|
Matrix4x4 | Returns the matrix that is the result of the multiplication. |
TranslationTimesMatrix(ref Matrix4x4, Vector3)
This function provides the equivalent of multiplying a translation matrix defined by the parameter translation with the matrix specified by the parameter inOutMatrix. The order of the equivalent multiplication is translation * inOutMatrix.
Declaration
public static void TranslationTimesMatrix(ref Matrix4x4 inOutMatrix, Vector3 translation)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | inOutMatrix | Matrix to multiply with translation. |
Vector3 | translation | Translation component to multiply to the matrix. |