RealDocs

UKismetMathLibrary::TransformRotation

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

Description

Transforms a rotator from the space T is relative to into T's local space. For example, if T is an object's world transform, this converts a local-space rotation into a world-space rotation.

Caveats & Gotchas

  • The rotation is only affected by T's rotation component; T's location and scale are ignored for this call.
  • Non-uniform scale on T can produce shear that a pure FRotator cannot represent, so results with skewed transforms may look wrong even though the math completes without error.

Signature

static FRotator TransformRotation(const FTransform& T, FRotator Rotation)

Parameters

Name Type Description Default
T const FTransform& The transform to apply.
Rotation FRotator The rotation to transform, expressed in the space that T is relative to.

Return Type

FRotator

Example

Convert a local rotation to world space C++
FRotator LocalOffset(0.f, 90.f, 0.f);
FRotator WorldRotation = UKismetMathLibrary::TransformRotation(GetActorTransform(), LocalOffset);

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.