Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/SpringMath
Description
A velocity spring will damp towards a target that follows a fixed linear target velocity, allowing control of the interpolation speed while still giving a smoothed behavior. A SmoothingTime of 0 will give a linear interpolation between X and TargetX
| Name | VelocitySpringDamperF |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Public/Animation/SpringMath.h |
| Include Path | #include "Animation/SpringMath.h" |
template<typename TFloat>
static void VelocitySpringDamperF
(
TFloat & InOutX,
TFloat & InOutV,
TFloat & InOutXi,
TFloat TargetX,
TFloat MaxSpeed,
float SmoothingTime,
float DeltaTime
)
Parameters
| Name | Remarks |
|---|---|
| InOutX | The value to be damped |
| InOutV | The velocity of the value to be damped |
| InOutXi | The intermediate target of the value to be damped |
| TargetX | The target value of X to damp towards |
| MaxSpeed | The desired speed to achieve while damping towards X |
| SmoothingTime | The smoothing time to use while damping towards X. Higher values will give more smoothed behaviour. A value of 0 will give a linear interpolation of X to Target |
| DeltaTime | The timestep in seconds |