UKismetMathLibrary::ResetQuaternionSpringState
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Resets a quaternion spring's angular velocity and previous-target tracking back to zero/identity, as if it had never run. Use this before reusing a spring for an unrelated rotation or after a large discontinuity in orientation.
Caveats & Gotchas
- • Only resets the internal spring state — the rotation value you pass into QuaternionSpringInterp as Current is unaffected, so snap that to the desired orientation separately if you need an immediate visual reset.
- • The spring state tracks angular velocity as an FVector, not a quaternion delta, so resetting sets that vector to zero and PrevTarget back to FQuat::Identity.
Signature
static void ResetQuaternionSpringState(UPARAM(ref) FQuaternionSpringState& SpringState) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SpringState | FQuaternionSpringState& | The spring state to reset. | — |
Return Type
void Example
Reset an orientation spring after snapping to a new facing direction C++
void AMyActor::SnapToOrientation(const FQuat& NewRotation)
{
UKismetMathLibrary::ResetQuaternionSpringState(OrientationSpringState);
SmoothedRotation = NewRotation;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?