UKismetMathLibrary::Quat_RotateVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Rotates a vector by the quaternion Q. Equivalent to FQuat::RotateVector but callable from Blueprint. Does not change the vector's length.
Caveats & Gotchas
- • The quaternion must be normalized (unit length) for correct results; non-unit quaternions will scale the output vector in addition to rotating it.
- • For world-to-local conversion use Quat_UnrotateVector instead; using Quat_RotateVector with the inverse quaternion is equivalent but less readable.
Signature
static UE_INL_API FVector Quat_RotateVector(const FQuat& Q, const FVector& V); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Q | const FQuat& | The quaternion representing the rotation to apply. | — |
| V | const FVector& | The vector to rotate. | — |
Return Type
FVector Example
Transform a local-space offset into world space C++
FQuat ActorRot = GetActorQuat();
FVector LocalOffset = FVector(100.f, 0.f, 0.f); // 1m forward in local space
FVector WorldOffset = UKismetMathLibrary::Quat_RotateVector(ActorRot, LocalOffset);
FVector WorldPos = GetActorLocation() + WorldOffset; Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?