<PackageReference Include="System.Numerics.Vectors" Version="4.5.0-rc1" />

System.Numerics.Matrix4x4

public struct Matrix4x4 : IEquatable<Matrix4x4>
Represents a 4x4 matrix.
public float M11

The first element of the first row.

public float M12

The second element of the first row.

public float M13

The third element of the first row.

public float M14

The fourth element of the first row.

public float M21

The first element of the second row.

public float M22

The second element of the second row.

public float M23

The third element of the second row.

public float M24

The fourth element of the second row.

public float M31

The first element of the third row.

public float M32

The second element of the third row.

public float M33

The third element of the third row.

public float M34

The fourth element of the third row.

public float M41

The first element of the fourth row.

public float M42

The second element of the fourth row.

public float M43

The third element of the fourth row.

public float M44

The fourth element of the fourth row.

public static Matrix4x4 Identity { get; }

Gets the multiplicative identity matrix.

public bool IsIdentity { get; }

Indicates whether the current matrix is the identity matrix.

public Vector3 Translation { get; set; }

Gets or sets the translation component of this matrix.

public Matrix4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)

Creates a 4x4 matrix from the specified components.

public Matrix4x4(Matrix3x2 value)

Creates a Matrix4x4 object from a specified Matrix3x2 object.

public static Matrix4x4 Add(Matrix4x4 value1, Matrix4x4 value2)

Adds each element in one matrix with its corresponding element in a second matrix.

public static Matrix4x4 CreateBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 cameraUpVector, Vector3 cameraForwardVector)

Creates a spherical billboard that rotates around a specified object position.

public static Matrix4x4 CreateConstrainedBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 rotateAxis, Vector3 cameraForwardVector, Vector3 objectForwardVector)

Creates a cylindrical billboard that rotates around a specified axis.

public static Matrix4x4 CreateFromAxisAngle(Vector3 axis, float angle)

Creates a matrix that rotates around an arbitrary vector.

public static Matrix4x4 CreateFromQuaternion(Quaternion quaternion)

Creates a rotation matrix from the specified Quaternion rotation value.

public static Matrix4x4 CreateFromYawPitchRoll(float yaw, float pitch, float roll)

Creates a rotation matrix from the specified yaw, pitch, and roll.

public static Matrix4x4 CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)

Creates a view matrix.

public static Matrix4x4 CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane)

Creates an orthographic perspective matrix from the given view volume dimensions.

public static Matrix4x4 CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane)

Creates a customized orthographic projection matrix.

public static Matrix4x4 CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance)

Creates a perspective projection matrix from the given view volume dimensions.

public static Matrix4x4 CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)

Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances.

public static Matrix4x4 CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance)

Creates a customized perspective projection matrix.

public static Matrix4x4 CreateReflection(Plane value)

Creates a matrix that reflects the coordinate system about a specified plane.

public static Matrix4x4 CreateRotationX(float radians)

Creates a matrix for rotating points around the X axis.

public static Matrix4x4 CreateRotationX(float radians, Vector3 centerPoint)

Creates a matrix for rotating points around the X axis from a center point.

public static Matrix4x4 CreateRotationY(float radians)

Creates a matrix for rotating points around the Y axis.

public static Matrix4x4 CreateRotationY(float radians, Vector3 centerPoint)

The amount, in radians, by which to rotate around the Y axis from a center point.

public static Matrix4x4 CreateRotationZ(float radians)

Creates a matrix for rotating points around the Z axis.

public static Matrix4x4 CreateRotationZ(float radians, Vector3 centerPoint)

Creates a matrix for rotating points around the Z axis from a center point.

public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale)

Creates a scaling matrix from the specified X, Y, and Z components.

public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale, Vector3 centerPoint)

Creates a scaling matrix that is offset by a given center point.

public static Matrix4x4 CreateScale(Vector3 scales)

Creates a scaling matrix from the specified vector scale.

public static Matrix4x4 CreateScale(Vector3 scales, Vector3 centerPoint)

Creates a scaling matrix with a center point.

public static Matrix4x4 CreateScale(float scale)

Creates a uniform scaling matrix that scale equally on each axis.

public static Matrix4x4 CreateScale(float scale, Vector3 centerPoint)

Creates a uniform scaling matrix that scales equally on each axis with a center point.

public static Matrix4x4 CreateShadow(Vector3 lightDirection, Plane plane)

Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source.

public static Matrix4x4 CreateTranslation(Vector3 position)

Creates a translation matrix from the specified 3-dimensional vector.

public static Matrix4x4 CreateTranslation(float xPosition, float yPosition, float zPosition)

Creates a translation matrix from the specified X, Y, and Z components.

public static Matrix4x4 CreateWorld(Vector3 position, Vector3 forward, Vector3 up)

Creates a world matrix with the specified parameters.

public static bool Decompose(Matrix4x4 matrix, out Vector3 scale, out Quaternion rotation, out Vector3 translation)

Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded.

public static bool Invert(Matrix4x4 matrix, out Matrix4x4 result)

Inverts the specified matrix. The return value indicates whether the operation succeeded.

public static Matrix4x4 Lerp(Matrix4x4 matrix1, Matrix4x4 matrix2, float amount)

Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix.

public static Matrix4x4 Multiply(Matrix4x4 value1, Matrix4x4 value2)

Returns the matrix that results from multiplying two matrices together.

public static Matrix4x4 Multiply(Matrix4x4 value1, float value2)

Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor.

public static Matrix4x4 Negate(Matrix4x4 value)

Negates the specified matrix by multiplying all its values by -1.

public static Matrix4x4 op_Addition(Matrix4x4 value1, Matrix4x4 value2)

Adds each element in one matrix with its corresponding element in a second matrix.

public static bool op_Equality(Matrix4x4 value1, Matrix4x4 value2)

Returns a value that indicates whether the specified matrices are equal.

public static bool op_Inequality(Matrix4x4 value1, Matrix4x4 value2)

Returns a value that indicates whether the specified matrices are not equal.

public static Matrix4x4 op_Multiply(Matrix4x4 value1, Matrix4x4 value2)

Returns the matrix that results from multiplying two matrices together.

public static Matrix4x4 op_Multiply(Matrix4x4 value1, float value2)

Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor.

public static Matrix4x4 op_Subtraction(Matrix4x4 value1, Matrix4x4 value2)

Subtracts each element in a second matrix from its corresponding element in a first matrix.

public static Matrix4x4 op_UnaryNegation(Matrix4x4 value)

Negates the specified matrix by multiplying all its values by -1.

public static Matrix4x4 Subtract(Matrix4x4 value1, Matrix4x4 value2)

Subtracts each element in a second matrix from its corresponding element in a first matrix.

public static Matrix4x4 Transform(Matrix4x4 value, Quaternion rotation)

Transforms the specified matrix by applying the specified Quaternion rotation.

public static Matrix4x4 Transpose(Matrix4x4 matrix)

Transposes the rows and columns of a matrix.

public bool Equals(Matrix4x4 other)

Returns a value that indicates whether this instance and another 4x4 matrix are equal.

public float GetDeterminant()

Calculates the determinant of the current 4x4 matrix.