mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 17:47:24 +02:00
14 lines
378 B
C#
14 lines
378 B
C#
using System;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.Client.UserInterface;
|
|
|
|
internal static class UIAnimations
|
|
{
|
|
// From https://blog.pkh.me/p/41-fixing-the-iterative-damping-interpolation-in-video-games.html
|
|
public static float LerpAnimate(float a, float b, float dt, float rate)
|
|
{
|
|
return MathHelper.Lerp(a, b, 1f - MathF.Exp(-dt * rate));
|
|
}
|
|
}
|