Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/SpringMath
Description
Simplified version of FMath::CriticallyDampedSmoothing where v_goal is assumed to be 0. This interpolates the value InOutX towards TargetX with the motion of a critically damped spring. The velocity of InOutX is stored in InOutV.
| Name | CriticalSpringDamper |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Math/SpringMath.h |
| Include Path | #include "Math/SpringMath.h" |
template<typename T>
static void CriticalSpringDamper
(
T & InOutX,
T & InOutV,
T TargetX,
float SmoothingTime,
float DeltaTime
)
Parameters
| Name | Remarks |
|---|---|
| T | The type to be damped |
| InOutX | The value to be damped |
| InOutV | The velocity of the value to be damped |
| TargetX | The goal to damp towards |
| SmoothingTime | The smoothing time to use for the spring. Longer times lead to more damped behaviour. A time of 0 will snap InOutX to TargetX |
| DeltaTime | Timestep in seconds |