Merge MathHelper and FloatMath
Requires space-wizards/RobustToolbox#1234
This commit is contained in:
@@ -87,7 +87,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
// Continually restore camera to 0.
|
||||
var normalized = _currentKick.Normalized;
|
||||
_lastKickTime += frameTime;
|
||||
var restoreRate = FloatMath.Lerp(RestoreRateMin, RestoreRateMax, Math.Min(1, _lastKickTime/RestoreRateRamp));
|
||||
var restoreRate = MathHelper.Lerp(RestoreRateMin, RestoreRateMax, Math.Min(1, _lastKickTime/RestoreRateRamp));
|
||||
var restore = normalized * restoreRate * frameTime;
|
||||
var (x, y) = _currentKick - restore;
|
||||
if (Math.Sign(x) != Math.Sign(_currentKick.X))
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
var progress = (_gameTiming.CurTime - start).TotalSeconds / length;
|
||||
var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5);
|
||||
|
||||
cooldownGraphic.Progress = FloatMath.Clamp((float)ratio, -1, 1);
|
||||
cooldownGraphic.Progress = MathHelper.Clamp((float)ratio, -1, 1);
|
||||
cooldownGraphic.Visible = ratio > -1f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user