UKismetMathLibrary::Conv_MatrixToRotator
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Extracts the rotation component from an FMatrix as an FRotator (Pitch/Yaw/Roll in degrees). Assumes the matrix represents a transform without shear.
Caveats & Gotchas
- • Scale in the matrix is ignored — only the directional (normalized) component of each basis vector is used for rotation extraction.
- • If the matrix is scaled non-uniformly, the extracted rotator may differ from what you'd get by normalizing rows first. Normalize the matrix with GetMatrixWithoutScale before calling this if scale accuracy matters.
Signature
static UE_INL_API FRotator Conv_MatrixToRotator(const FMatrix& InMatrix) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InMatrix | const FMatrix& | The matrix to convert. Assumes it represents a transform. | — |
Return Type
FRotator Example
Get the facing direction of a skeletal mesh bone as a Rotator C++
FMatrix BoneMatrix = Mesh->GetBoneMatrix(BoneIndex);
FRotator BoneRotation = UKismetMathLibrary::Conv_MatrixToRotator(BoneMatrix); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?