Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Math > API/Runtime/Core/Math/FMath
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h |
| Include | #include "Math/UnrealMathUtility.h" |
template<class T>
static constexpr void CriticallyDampedSmoothing
&40;
T & InOutValue,
T & InOutValueRate,
const T & InTargetValue,
const T & InTargetValueRate,
const float InDeltaTime,
const float InSmoothingTime
&41;
Remarks
Smooths a value using a critically damped spring. Works for any type that supports basic arithmetic operations.
Note that InSmoothingTime is the time lag when tracking constant motion (so if you tracked a predicted position TargetVel * InSmoothingTime ahead, you'd match the target position)
An approximation is used that is accurate so long as InDeltaTime < 0.5 * InSmoothingTime
When starting from zero velocity, the maximum velocity is reached after time InSmoothingTime * 0.5
Parameters
| Name | Description |
|---|---|
| InOutValue | The value to be smoothed |
| InOutValueRate | The rate of change of the value |
| InTargetValue | The target to smooth towards |
| InTargetValueRate | The target rate of change smooth towards. Note that if this is discontinuous, then the output will have discontinuous velocity too. |
| InDeltaTime | Time interval |
| InSmoothingTime | Timescale over which to smooth. Larger values result in more smoothed behaviour. Can be zero. |