UKismetMathLibrary::EqualEqual_MatrixMatrix
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns true if two matrices are equal within the given per-element tolerance. Performs 16 individual element comparisons.
Caveats & Gotchas
- • The default tolerance of 1e-4 is appropriate for transform matrices in UE's coordinate scale. For matrices built from high-magnitude values (e.g. large world coordinates), consider tightening or relaxing the tolerance accordingly.
- • Two matrices that represent the same rotation but have different scales will not compare as equal — this is a raw element-wise comparison, not a semantic transform equivalence check.
Signature
static UE_INL_API bool EqualEqual_MatrixMatrix(const FMatrix& A, const FMatrix& B, float Tolerance = 1.e-4f) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FMatrix& | The first matrix to compare. | — |
| B | const FMatrix& | The second matrix to compare. | — |
| Tolerance | float | Per-element error tolerance for the comparison. | 1.e-4f |
Return Type
bool Example
Verify a matrix inverse round-trip C++
FMatrix Inv = UKismetMathLibrary::Matrix_GetInverse(M);
FMatrix Product = UKismetMathLibrary::Multiply_MatrixMatrix(M, Inv);
bool bIsIdentity = UKismetMathLibrary::EqualEqual_MatrixMatrix(Product, UKismetMathLibrary::Matrix_Identity()); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?