Merge MathHelper and FloatMath

Requires  space-wizards/RobustToolbox#1234
This commit is contained in:
Visne
2020-08-16 14:54:52 +02:00
parent 745f028b89
commit 0b448b500d
18 changed files with 27 additions and 27 deletions

View File

@@ -17,7 +17,7 @@ namespace Content.Server.AI.Utility.Considerations
var modificationFactor = 1.0f - 1.0f / considerationsCount;
var makeUpValue = (1.0f - score) * modificationFactor;
var adjustedScore = score + makeUpValue * score;
return FloatMath.Clamp(adjustedScore, 0.0f, 1.0f);
return MathHelper.Clamp(adjustedScore, 0.0f, 1.0f);
}
[Pure]
@@ -59,7 +59,7 @@ namespace Content.Server.AI.Utility.Considerations
[Pure]
private static float LogisticCurve(float x, float slope, float exponent, float yOffset, float xOffset)
{
return FloatMath.Clamp(
return MathHelper.Clamp(
exponent * (1 / (1 + (float) Math.Pow(Math.Log(1000) * slope, -1 * x + xOffset))) + yOffset, 0.0f, 1.0f);
}
@@ -77,7 +77,7 @@ namespace Content.Server.AI.Utility.Considerations
[Pure]
private static float QuadraticCurve(float x, float slope, float exponent, float yOffset, float xOffset)
{
return FloatMath.Clamp(slope * (float) Math.Pow(x - xOffset, exponent) + yOffset, 0.0f, 1.0f);
return MathHelper.Clamp(slope * (float) Math.Pow(x - xOffset, exponent) + yOffset, 0.0f, 1.0f);
}
public Func<float> QuadraticCurve(Blackboard context, float slope, float exponent, float yOffset, float xOffset)