UKismetMathLibrary::Multiply_QuatQuat
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Multiplies two quaternions, composing their rotations. The result represents first applying B, then A.
Caveats & Gotchas
- • Quaternion multiplication is not commutative — A * B ≠ B * A in general. The header comment explicitly states B is applied first, then A; reversing arguments produces a different rotation.
- • Repeated multiplication without re-normalisation accumulates floating-point drift; call Normalize() periodically when chaining many rotations together.
Signature
static UE_INL_API FQuat Multiply_QuatQuat(const FQuat& A, const FQuat& B) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FQuat& | The left-hand quaternion (applied second in the composed rotation). | — |
| B | const FQuat& | The right-hand quaternion (applied first in the composed rotation). | — |
Return Type
FQuat Example
Compose a local rotation with a world rotation C++
FQuat WorldRot = GetActorQuat();
FQuat LocalSpin = FQuat(FVector::UpVector, FMath::DegreesToRadians(45.0f));
// Apply local spin first, then world rotation
FQuat Combined = UKismetMathLibrary::Multiply_QuatQuat(WorldRot, LocalSpin);
SetActorRotation(Combined.Rotator()); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?