Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/SpringMath
Description
A double spring damper that interpolates the value InOutX towards TargetX via some intermediate state - producing a more S-shaped curve. The velocity of InOutX is stored in InOutV.
| Name | CriticalDoubleSpringDamper |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Math/SpringMath.h |
| Include Path | #include "Math/SpringMath.h" |
template<typename T>
static void CriticalDoubleSpringDamper
(
T & InOutX,
T & InOutV,
T & InOutXi,
T & InOutVi,
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 |
| InOutXi | The value of the intermediate state |
| InOutVi | The velocity of the intermediate state |
| 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 |