XMMatrixInverse

Computes the inverse of a matrix.

Syntax

XMMATRIX XMMatrixInverse(
         XMVECTOR *pDeterminant,
         CXMMATRIX M
)  

Parameters

pDeterminant
Type: XMVECTOR *

[out, optional]

Address of a vector, each of whose components is the determinant of M. This parameter can be a nullptr.

M
Type: CXMMATRIX 

[in]

Matrix to invert.

Return value

Type: XMMATRIX 

Returns the matrix inverse of M. If there is no inverse (that is, if the determinant is 0), XMMatrixInverse returns an infinite matrix.

Remarks

Note

For XNAMATH version 2.04 and earlier, the pDeterminant parameter isn’t optional. That is, for XNAMATH version 2.04 and earlier, you can’t set pDeterminant to a nullptr.

Requirements

Header: Declared in directxmath.h.