Skip to content

Commit ad210fd

Browse files
committed
docs: Add short explanation and link to reference material
1 parent 39fb000 commit ad210fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Source/ORTS.Common/SmoothedData.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public void Update(float periodS, float newValue)
5959

6060
protected void SmoothValue(ref float smoothedValue, float periodS, float newValue)
6161
{
62+
// This formula and the calculation of `rate` are FPS-independent; see https://www.gamedeveloper.com/programming/improved-lerp-smoothing- for more details
6263
var ratio = (float)Math.Exp(-rate * periodS);
6364
if (float.IsNaN(smoothedValue) || float.IsInfinity(smoothedValue) || ratio < 0.5)
6465
smoothedValue = newValue;

0 commit comments

Comments
 (0)