RealDocs

UKismetMathLibrary::Matrix_GetDeterminant

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Computes the determinant of the full 4x4 matrix. The determinant indicates volume scaling and whether the matrix is invertible (determinant near zero means singular).

Caveats & Gotchas

  • A determinant of zero (or near zero) means the matrix is singular and has no inverse — calling Matrix_GetInverse on such a matrix will return a zero or garbage matrix.
  • Negative determinants indicate a reflection (mirrored transform). This matters for face winding: a negative-determinant transform matrix will flip triangle winding order, causing backface culling to cull the wrong faces.

Signature

static UE_INL_API float Matrix_GetDeterminant(const FMatrix& M)

Parameters

Name Type Description Default
M const FMatrix& The matrix whose determinant to compute.

Return Type

float

Example

Guard against singular matrix before inverting C++
float Det = UKismetMathLibrary::Matrix_GetDeterminant(M);
if (FMath::Abs(Det) > SMALL_NUMBER)
{
    FMatrix Inv = UKismetMathLibrary::Matrix_GetInverse(M);
    // safe to use Inv
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.