struct Matrix4x4

in global :: System . Numerics

Represents a 4x4 matrix.


public Matrix4x4( Matrix3x2 value )

Creates a object from a specified object.

  • value A 3x2 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.

  • m11 The value to assign to the first element in the first row.
  • m12 The value to assign to the second element in the first row.
  • m33 The value to assign to the third element in the third row.
  • m34 The value to assign to the fourth element in the third row.
  • m41 The value to assign to the first element in the fourth row.
  • m42 The value to assign to the second element in the fourth row.
  • m43 The value to assign to the third element in the fourth row.
  • m44 The value to assign to the fourth element in the fourth row.
  • m13 The value to assign to the third element in the first row.
  • m14 The value to assign to the fourth element in the first row.
  • m21 The value to assign to the first element in the second row.
  • m22 The value to assign to the second element in the second row.
  • m23 The value to assign to the third element in the second row.
  • m24 The value to assign to the third element in the second row.
  • m31 The value to assign to the first element in the third row.
  • m32 The value to assign to the second element in the third row.

public static Matrix4x4 Add( Matrix4x4 value1, Matrix4x4 value2 )

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

  • value1 The first matrix.
  • value2 The second matrix.
  • Returns The matrix that contains the summed values of and .

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

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

  • objectPosition The position of the object that the billboard will rotate around.
  • cameraPosition The position of the camera.
  • cameraUpVector The up vector of the camera.
  • cameraForwardVector The forward vector of the camera.
  • Returns The created billboard.

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

Creates a cylindrical billboard that rotates around a specified axis.

  • objectPosition The position of the object that the billboard will rotate around.
  • cameraPosition The position of the camera.
  • rotateAxis The axis to rotate the billboard around.
  • cameraForwardVector The forward vector of the camera.
  • objectForwardVector The forward vector of the object.
  • Returns The billboard matrix.

public static Matrix4x4 CreateFromAxisAngle( Vector3 axis, float angle )

Creates a matrix that rotates around an arbitrary vector.

  • axis The axis to rotate around.
  • angle The angle to rotate around , in radians.
  • Returns The rotation matrix.

public static Matrix4x4 CreateFromQuaternion( Quaternion quaternion )

Creates a rotation matrix from the specified Quaternion rotation value.

  • quaternion The source Quaternion.
  • Returns The rotation matrix.

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

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

  • yaw The angle of rotation, in radians, around the Y axis.
  • pitch The angle of rotation, in radians, around the X axis.
  • roll The angle of rotation, in radians, around the Z axis.
  • Returns The rotation matrix.

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

Creates a view matrix.

  • cameraPosition The position of the camera.
  • cameraTarget The target towards which the camera is pointing.
  • cameraUpVector The direction that is "up" from the camera's point of view.
  • Returns The 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.

  • width The width of the view volume.
  • height The height of the view volume.
  • zNearPlane The minimum Z-value of the view volume.
  • zFarPlane The maximum Z-value of the view volume.
  • Returns The orthographic projection matrix.

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

Creates a customized orthographic projection matrix.

  • left The minimum X-value of the view volume.
  • right The maximum X-value of the view volume.
  • bottom The minimum Y-value of the view volume.
  • top The maximum Y-value of the view volume.
  • zNearPlane The minimum Z-value of the view volume.
  • zFarPlane The maximum Z-value of the view volume.
  • Returns The 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.

  • width The width of the view volume at the near view plane.
  • height The height of the view volume at the near view plane.
  • nearPlaneDistance The distance to the near view plane.
  • farPlaneDistance The distance to the far view plane.
  • Returns The perspective projection matrix.

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.

  • fieldOfView The field of view in the y direction, in radians.
  • aspectRatio The aspect ratio, defined as view space width divided by height.
  • nearPlaneDistance The distance to the near view plane.
  • farPlaneDistance The distance to the far view plane.
  • Returns The perspective projection matrix.

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

Creates a customized perspective projection matrix.

  • left The minimum x-value of the view volume at the near view plane.
  • right The maximum x-value of the view volume at the near view plane.
  • bottom The minimum y-value of the view volume at the near view plane.
  • top The maximum y-value of the view volume at the near view plane.
  • nearPlaneDistance The distance to the near view plane.
  • farPlaneDistance The distance to the far view plane.
  • Returns The perspective projection matrix.

public static Matrix4x4 CreateReflection( Plane value )

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

  • value The plane about which to create a reflection.
  • Returns A new matrix expressing the reflection.

public static Matrix4x4 CreateRotationX( float radians )

Creates a matrix for rotating points around the X axis.

  • radians The amount, in radians, by which to rotate around the X axis.
  • Returns The rotation matrix.

public static Matrix4x4 CreateRotationX( float radians, Vector3 centerPoint )

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

  • radians The amount, in radians, by which to rotate around the X axis.
  • centerPoint The center point.
  • Returns The rotation matrix.

public static Matrix4x4 CreateRotationY( float radians )

Creates a matrix for rotating points around the Y axis.

  • radians The amount, in radians, by which to rotate around the Y-axis.
  • Returns The rotation matrix.

public static Matrix4x4 CreateRotationY( float radians, Vector3 centerPoint )

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

  • radians The amount, in radians, by which to rotate around the Y-axis.
  • centerPoint The center point.
  • Returns The rotation matrix.

public static Matrix4x4 CreateRotationZ( float radians )

Creates a matrix for rotating points around the Z axis.

  • radians The amount, in radians, by which to rotate around the Z-axis.
  • Returns The rotation matrix.

public static Matrix4x4 CreateRotationZ( float radians, Vector3 centerPoint )

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

  • radians The amount, in radians, by which to rotate around the Z-axis.
  • centerPoint The center point.
  • Returns The rotation matrix.

public static Matrix4x4 CreateScale( Vector3 scales )

Creates a scaling matrix from the specified vector scale.

  • scales The scale to use.
  • Returns The scaling matrix.

public static Matrix4x4 CreateScale( Vector3 scales, Vector3 centerPoint )

Creates a scaling matrix with a center point.

  • scales The vector that contains the amount to scale on each axis.
  • centerPoint The center point.
  • Returns The scaling matrix.

public static Matrix4x4 CreateScale( float scale )

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

  • scale The uniform scaling factor.
  • Returns The scaling matrix.

public static Matrix4x4 CreateScale( float scale, Vector3 centerPoint )

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

  • scale The uniform scaling factor.
  • centerPoint The center point.
  • Returns The scaling matrix.

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

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

  • xScale The value to scale by on the X axis.
  • yScale The value to scale by on the Y axis.
  • zScale The value to scale by on the Z axis.
  • Returns The scaling matrix.

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

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

  • xScale The value to scale by on the X axis.
  • yScale The value to scale by on the Y axis.
  • zScale The value to scale by on the Z axis.
  • centerPoint The center point.
  • Returns The scaling matrix.

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.

  • lightDirection The direction from which the light that will cast the shadow is coming.
  • plane The plane onto which the new matrix should flatten geometry so as to cast a shadow.
  • Returns A new matrix that can be used to flatten geometry onto the specified plane from the specified direction.

public static Matrix4x4 CreateTranslation( Vector3 position )

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

  • position The amount to translate in each axis.
  • Returns The translation matrix.

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

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

  • xPosition The amount to translate on the X axis.
  • yPosition The amount to translate on the Y axis.
  • zPosition The amount to translate on the Z axis.
  • Returns The translation matrix.

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

Creates a world matrix with the specified parameters.

  • position The position of the object.
  • forward The forward direction of the object.
  • up The upward direction of the object. Its value is usually [0, 1, 0].
  • Returns The world matrix.

public static bool Decompose( Matrix4x4 matrix, ref Vector3 scale, ref Quaternion rotation, ref 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.

  • matrix The source matrix.
  • scale When this method returns, contains the scaling component of the transformation matrix if the operation succeeded.
  • rotation When this method returns, contains the rotation component of the transformation matrix if the operation succeeded.
  • translation When the method returns, contains the translation component of the transformation matrix if the operation succeeded.
  • Returns if was decomposed successfully; otherwise, .

public bool Equals( Matrix4x4 other )

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

  • other The other matrix.
  • Returns if the two matrices are equal; otherwise, .

public bool Equals( object obj )

Returns a value that indicates whether this instance and a specified object are equal.

  • obj The object to compare with the current instance.
  • Returns if the current instance and are equal; otherwise, . If is , the method returns .

public static Matrix4x4 Identity { get; }

Gets the multiplicative identity matrix.

  • Returns Gets the multiplicative identity matrix.

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

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

  • matrix The matrix to invert.
  • result When this method returns, contains the inverted matrix if the operation succeeded.
  • Returns if was converted successfully; otherwise, .

public bool IsIdentity { get; }

Indicates whether the current matrix is the identity matrix.

  • Returns if the current matrix is the identity matrix; otherwise, .

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.

  • matrix1 The first matrix.
  • matrix2 The second matrix.
  • amount The relative weighting of .
  • Returns The interpolated 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 Multiply( Matrix4x4 value1, Matrix4x4 value2 )

Returns the matrix that results from multiplying two matrices together.

  • value1 The first matrix.
  • value2 The second matrix.
  • Returns The product matrix.

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.

  • value1 The matrix to scale.
  • value2 The scaling value to use.
  • Returns The scaled matrix.

public static Matrix4x4 Negate( Matrix4x4 value )

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

  • value The matrix to negate.
  • Returns The negated matrix.

public static Matrix4x4 op_Addition( Matrix4x4 value1, Matrix4x4 value2 )

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

  • value1 The first matrix.
  • value2 The second matrix.
  • Returns The matrix that contains the summed values.

public static bool op_Equality( Matrix4x4 value1, Matrix4x4 value2 )

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

  • value1 The first matrix to compare.
  • value2 The second matrix to care
  • Returns if and are equal; otherwise, .

public static bool op_Inequality( Matrix4x4 value1, Matrix4x4 value2 )

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

  • value1 The first matrix to compare.
  • value2 The second matrix to compare.
  • Returns if and are not equal; otherwise, .

public static Matrix4x4 op_Multiply( Matrix4x4 value1, Matrix4x4 value2 )

Returns the matrix that results from multiplying two matrices together.

  • value1 The first matrix.
  • value2 The second matrix.
  • Returns The product matrix.

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.

  • value1 The matrix to scale.
  • value2 The scaling value to use.
  • Returns The scaled matrix.

public static Matrix4x4 op_Subtraction( Matrix4x4 value1, Matrix4x4 value2 )

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

  • value1 The first matrix.
  • value2 The second matrix.
  • Returns The matrix containing the values that result from subtracting each element in from its corresponding element in .

public static Matrix4x4 op_UnaryNegation( Matrix4x4 value )

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

  • value The matrix to negate.
  • Returns The negated matrix.

public static Matrix4x4 Subtract( Matrix4x4 value1, Matrix4x4 value2 )

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

  • value1 The first matrix.
  • value2 The second matrix.
  • Returns The matrix containing the values that result from subtracting each element in from its corresponding element in .

public static Matrix4x4 Transform( Matrix4x4 value, Quaternion rotation )

Transforms the specified matrix by applying the specified Quaternion rotation.

  • value The matrix to transform.
  • rotation The rotation t apply.
  • Returns The transformed matrix.

public Vector3 Translation { get; set; }

Gets or sets the translation component of this matrix.

  • Returns The translation component of the current instance.

public static Matrix4x4 Transpose( Matrix4x4 matrix )

Transposes the rows and columns of a matrix.

  • matrix The matrix to transpose.
  • Returns The transposed matrix.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public float GetDeterminant( )

😔 No documentation found.

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

😔 No documentation found.

public static Matrix4x4 CreateViewportLeftHanded( float x, float y, float width, float height, float minDepth, float maxDepth )

😔 No documentation found.

public static Matrix4x4 CreateViewport( float x, float y, float width, float height, float minDepth, float maxDepth )

😔 No documentation found.

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

😔 No documentation found.

public static Matrix4x4 CreateLookTo( Vector3 cameraPosition, Vector3 cameraDirection, Vector3 cameraUpVector )

😔 No documentation found.

public static Matrix4x4 CreateLookToLeftHanded( Vector3 cameraPosition, Vector3 cameraDirection, Vector3 cameraUpVector )

😔 No documentation found.

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

😔 No documentation found.

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

😔 No documentation found.

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

😔 No documentation found.

public float Item { get; set; }

😔 No documentation found.

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

😔 No documentation found.