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