RealDocs

UKismetMathLibrary::SetQuaternionSpringStateAngularVelocity

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Overwrites the internal angular velocity stored in a quaternion spring state, useful for injecting an instantaneous rotational impulse into an ongoing QuaternionSpringInterp.

Caveats & Gotchas

  • AngularVelocity is an axis-angle vector — its direction is the rotation axis and its magnitude is speed in radians/second — not a rotator or Euler angles.
  • Only affects the momentum used on the spring's next update; the rotation value being interpolated does not snap or change immediately.

Signature

static void SetQuaternionSpringStateAngularVelocity(UPARAM(ref) FQuaternionSpringState& SpringState, FVector AngularVelocity)

Parameters

Name Type Description Default
SpringState FQuaternionSpringState& The spring state whose internal angular velocity is overwritten.
AngularVelocity FVector The new angular velocity to assign, as an axis-angle vector in radians/second.

Return Type

void

Example

Kick a rotational spring on impact C++
void AMyProp::OnHit()
{
    UKismetMathLibrary::SetQuaternionSpringStateAngularVelocity(TiltSpringState, FVector(0.f, 3.f, 0.f));
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.