Struct Matrix4
Matrix4 structure
4x4 matrix implementation.
public struct Matrix4
Constructors
Name | Description |
---|
Matrix4(double[]) | Initializes a new instance of the Matrix4 struct. |
Matrix4(FMatrix4) | Construct Matrix4 from an FMatrix4 instance |
Matrix4(Vector4, Vector4, Vector4, Vector4) | Constructs matrix from 4 rows. |
Matrix4(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double) | Initializes a new instance of the Matrix4 struct. |
Properties
Name | Description |
---|
static Identity { get; } | Gets the identity matrix. |
Determinant { get; } | Gets the determinant of the matrix. |
Methods
Name | Description |
---|
static Rotate(Quaternion) | Create a rotation matrix from a quaternion |
static Rotate(double, Vector3) | Create a rotation matrix by rotation angle and axis |
static RotateFromEuler(Vector3) | Create a rotation matrix from Euler angle |
static RotateFromEuler(double, double, double) | Create a rotation matrix from Euler angle |
static Scale(double) | Creates a matrix that scales along the x-axis, the y-axis and the z-axis. |
static Scale(Vector3) | Creates a matrix that scales along the x-axis, the y-axis and the z-axis. |
static Scale(double, double, double) | Creates a matrix that scales along the x-axis, the y-axis and the z-axis. |
static Translate(Vector3) | Creates a matrix that translates along the x-axis, the y-axis and the z-axis |
static Translate(double, double, double) | Creates a matrix that translates along the x-axis, the y-axis and the z-axis |
Concatenate(Matrix4) | Concatenates the two matrices |
Decompose(out Vector3, out Vector3, out Quaternion) | |
Inverse() | Inverses this instance. |
Normalize() | Normalizes this instance. |
SetTRS(Vector3, Vector3, Vector3) | Initializes the matrix with translation/rotation/scale |
ToArray() | Converts matrix to array. |
override ToString() | Returns a String that represents the current Matrix4 . |
Transpose() | Transposes this instance. |
operator * | Multiply the two matrices (4 operators) |
Fields
Examples
Matrix4 mat = Matrix4.RotateFromEuler(90, 0, 0);
Matrix4 mat2 = Matrix4.Translate(0, 10, -50);
Matrix4 transform = mat2 * mat;
Vector4 pos = new Vector4(10, 9, 0, 1);
Vector4 transformed = transform * pos;
See Also