Struct Matrix4x5
A 4x5 matrix to describe 4D transformation
public struct Matrix4x5
Constructors
Matrix4x5(Vector4, Matrix4)
Create a new 4x5 matrix.
public Matrix4x5(Vector4 position, Matrix4 rotation)
Fields
position
Fifth column of the matrix, denoted as a translation vector.
public Vector4 position
rotation
4x4 part of the matrix, denoted as a rotational matrix.
public Matrix4 rotation
Properties
forward
Get the forward (Z+) axis of the transform
public Vector4 forward { get; }
identity
Get a 4x5 identity matrix
public static Matrix4x5 identity { get; }
overward
Get the overward (W+) axis of the transform
public Vector4 overward { get; }
rightward
Get the right (X+) axis of the transform
public Vector4 rightward { get; }
upward
Get the up (Y+) axis of the transform
public Vector4 upward { get; }
Methods
Inverse(Matrix4x5)
Inverse the matrix
public static Matrix4x5 Inverse(Matrix4x5 t)
ToTRS(Vector4)
Convert to non-orthogonal matrix by applying a scale
public Matrix4x5 ToTRS(Vector4 scale)
Remarks
Do not inverse or multiply any matrix produced using this method.
Operators
Division(Matrix4x5, Matrix4x5)
Inversely combine two matrices
public static Matrix4x5 operator /(Matrix4x5 u, Matrix4x5 t)
Remarks
The operation is designed such that A * B / B is equivalent to A.
Division(Vector4, Matrix4x5)
Inversely transforms a point.
public static Vector4 operator /(Vector4 v, Matrix4x5 tx)
Remarks
This operation is equivalent to Inverse(matrix) * vector
Multiply(Matrix4x5, Bounds4)
Convert to OBB, transform, then wrap it inside AABB back
public static Bounds4 operator *(Matrix4x5 t, Bounds4 u)
Multiply(Matrix4x5, Matrix4x5)
Combine two transformations.
public static Matrix4x5 operator *(Matrix4x5 t, Matrix4x5 u)
Remarks
The operation is not commutative
Multiply(Matrix4x5, Plane4)
Transform the right-hand plane
public static Plane4 operator *(Matrix4x5 tx, Plane4 p)
Multiply(Matrix4x5, Vector4)
Transforms a point
public static Vector4 operator *(Matrix4x5 tx, Vector4 v)
Remarks
This operator does translate the vector, Otherwise you should only multiply with the rotational part of this 4x5 matrix.