Matrix2D
A 2x3 transformation matrix used for 2D operations.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Struct
- Namespace: Unity.VectorGraphics
- Assembly: UnityEngine.VectorGraphicsModule
- Implements: IEquatable<Matrix2D>, IFormattable
public struct Matrix2D : IEquatable<Matrix2D>, IFormattable
Fields
Value | Description |
|---|---|
| m00 | The matrix member at (0,0) |
| m01 | The matrix member at (0,1) |
| m02 | The matrix member at (0,2) |
| m10 | The matrix member at (1,0) |
| m11 | The matrix member at (1,1) |
| m12 | The matrix member at (1,2) |
Constructors
Constructor | Description |
|---|---|
| Matrix2D(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2) | Initializes a Matrix2D with column vectors |
Properties
Property | Description |
|---|---|
| this[] | Access element at sequential index (0..5 inclusive). |
Static Properties
Property | Description |
|---|---|
| identity | Returns the identity matrix (read-only). |
| zero | Returns a matrix with all elements set to zero (read-only). |
Methods
Method | Description |
|---|---|
| Equals | Checks if two matrices are equal. |
| GetColumn | Gets a column of the matrix. |
| GetHashCode | Gets a hashcode of the matrix. |
| GetRow | Gets a row of the matrix. |
| Inverse | Computes the inverse of the matrix. |
| MultiplyPoint | Transforms a position by this matrix (effectively by 2x3). |
| MultiplyVector | Transforms a direction by this matrix. |
| SetColumn | Sets a column of the matrix. |
| SetRow | Sets a row of the matrix. |
| ToString | Returns a string representation of the matrix. |
Static Methods
Method | Description |
|---|---|
| RotateLH | Creates a left-hand side rotation matrix. |
| RotateRH | Creates a right-hand side rotation matrix. |
| Scale | Creates a scaling matrix. |
| SkewX | Creates a skew matrix on X. |
| SkewY | Creates a skew matrix on U. |
| Translate | Creates a translation matrix. |
Operators
Operator | Description |
|---|---|
| operator == | Checks if two matrices are equal. |
| operator != | Checks if two matrices are not equal. |
| operator * | Multiplies two matrices. |