UKismetMathLibrary::InverseTransformDirection
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Transforms a direction vector by the inverse of the supplied transform without changing its length. For example, if T is an object's world transform, this converts a world-space direction into that object's local space.
Caveats & Gotchas
- • Unlike InverseTransformLocation, translation is ignored — only rotation and scale are applied, since directions have no position.
- • The output length can still change if T has non-uniform scale, even though the function is documented as length-preserving for the uniform-scale case.
Signature
static FVector InverseTransformDirection(const FTransform& T, FVector Direction) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| T | const FTransform& | The transform whose inverse is applied. | — |
| Direction | FVector | The world-space direction to convert into T's local space. | — |
Return Type
FVector Example
Convert a world-space movement direction to local space C++
FVector WorldForward = GetVelocity().GetSafeNormal();
FVector LocalForward = UKismetMathLibrary::InverseTransformDirection(GetActorTransform(), WorldForward); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?