UKismetMathLibrary::Quat_GetAxisY
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the right direction (local Y axis) of the coordinate frame represented by this quaternion. Equivalent to rotating FVector::RightVector (0,1,0) by Q.
Caveats & Gotchas
- • In UE's coordinate system Y points right. If you need to strafe a character, this gives the correct strafing direction without converting through FRotator.
- • The result is only a unit vector if Q is normalized. Non-unit quaternions (e.g. from accumulated floating-point drift) will produce scaled axis vectors.
Signature
static UE_INL_API FVector Quat_GetAxisY(const FQuat& Q); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Q | const FQuat& | The quaternion representing the orientation. | — |
Return Type
FVector Example
Apply lateral force relative to orientation C++
FQuat ActorQuat = GetActorQuat();
FVector Right = UKismetMathLibrary::Quat_GetAxisY(ActorQuat);
GetMovementComponent()->AddForce(Right * LateralForce); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?