RealDocs

UKismetMathLibrary::Matrix_GetTransposeAdjoint

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

Description

Returns the transpose adjoint (cofactor matrix transposed) of the given matrix. Used in normal-vector transformations when non-uniform scaling is involved — multiply a normal by the transpose adjoint instead of the regular matrix to keep normals perpendicular to surfaces.

Caveats & Gotchas

  • The transpose adjoint is NOT the same as the inverse transpose. For an orthogonal matrix they coincide, but for matrices with shear or non-uniform scale they differ — make sure you want the adjoint, not UKismetMathLibrary::Matrix_GetInverse.
  • This operation involves computing all 9 cofactors of the 3×3 rotation sub-matrix and is comparatively expensive; avoid calling it every frame per mesh instance. Prefer pre-computing it when the matrix is known to be static.

Signature

static UE_INL_API FMatrix Matrix_GetTransposeAdjoint(const FMatrix& M)

Parameters

Name Type Description Default
M const FMatrix& The input matrix.

Return Type

FMatrix

Example

Transform normals through a non-uniformly scaled matrix C++
FMatrix WorldMatrix = MyComponent->GetComponentTransform().ToMatrixWithScale();
FMatrix AdjointMat = UKismetMathLibrary::Matrix_GetTransposeAdjoint(WorldMatrix);

// Transform a local-space normal so it stays perpendicular after non-uniform scale
FVector LocalNormal = FVector(0.f, 0.f, 1.f);
FVector WorldNormal = AdjointMat.TransformVector(LocalNormal).GetSafeNormal();

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.