UKismetMathLibrary::Matrix_GetMatrixWithoutScale
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns a copy of the matrix with scale removed — each row is normalised to unit length. Unlike Matrix_RemoveScaling, the original matrix is untouched.
Caveats & Gotchas
- • Only the rotation 3×3 rows are normalised; the translation row (W column) is preserved verbatim, so the resulting matrix still carries the original translation.
- • If the input matrix contains shear (non-orthogonal rotation rows after scale removal), the output rows will be unit-length but not necessarily orthogonal — further orthogonalisation is needed if a pure rotation is required.
Signature
static UE_INL_API FMatrix Matrix_GetMatrixWithoutScale(const FMatrix& M, float Tolerance = 1.e-8f) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| M | const FMatrix& | The source matrix. Not modified. | — |
| Tolerance | float | Rows whose magnitude is below this threshold are left unchanged. | 1.e-8f |
Return Type
FMatrix Example
Extract pure-rotation matrix without altering source C++
const FMatrix Scaled = Actor->GetTransform().ToMatrixWithScale();
FMatrix Unscaled = UKismetMathLibrary::Matrix_GetMatrixWithoutScale(Scaled);
FRotator PureRotation = UKismetMathLibrary::Matrix_GetRotator(Unscaled); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?