RealDocs

UKismetMathLibrary::Matrix_GetTransposed

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

Description

Returns the transpose of the matrix (rows and columns swapped). For a pure rotation matrix (orthonormal, no scale), the transpose equals the inverse.

Caveats & Gotchas

  • The transpose is only equal to the inverse for orthonormal rotation matrices (determinant = ±1, no scale, no shear). If the matrix has any scale, using the transpose as an inverse will produce wrong results.
  • Transposing is frequently used to convert between row-major and column-major matrix conventions when interfacing with OpenGL or shader constants that expect column vectors.

Signature

static UE_INL_API FMatrix Matrix_GetTransposed(const FMatrix& M)

Parameters

Name Type Description Default
M const FMatrix& The matrix to transpose.

Return Type

FMatrix

Example

Invert a pure rotation matrix cheaply via transpose C++
// Only valid when M is a pure rotation (determinant == 1, no scale)
FMatrix InverseRotation = UKismetMathLibrary::Matrix_GetTransposed(RotationOnlyMatrix);

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.