mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Add Timespan helpers (#4342)
This commit is contained in:
@@ -338,6 +338,16 @@ namespace Robust.Shared.Maths
|
||||
return MathF.Max(MathF.Min(a, b), MathF.Min(MathF.Max(a, b), c));
|
||||
}
|
||||
|
||||
public static TimeSpan Min(TimeSpan a, TimeSpan b)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
}
|
||||
|
||||
public static TimeSpan Max(TimeSpan a, TimeSpan b)
|
||||
{
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
#endregion MinMax
|
||||
|
||||
#region Mod
|
||||
@@ -592,6 +602,11 @@ namespace Robust.Shared.Maths
|
||||
return a + (b - a) * blend;
|
||||
}
|
||||
|
||||
public static TimeSpan Lerp(TimeSpan a, TimeSpan b, double t)
|
||||
{
|
||||
return a + t * (b - a);
|
||||
}
|
||||
|
||||
#endregion Lerp
|
||||
|
||||
#region InterpolateCubic
|
||||
|
||||
Reference in New Issue
Block a user