Automatically set slider velocity from juice stream path

This commit is contained in:
ekrctb
2022-05-08 21:17:57 +09:00
parent 4e0155fa4b
commit 9ffa90602b
2 changed files with 25 additions and 2 deletions

View File

@ -207,6 +207,11 @@ namespace osu.Game.Rulesets.Catch.Objects
{
double xDifference = Math.Abs((double)vertices[i].X - vertices[i - 1].X);
double timeDifference = vertices[i].Time - vertices[i - 1].Time;
// A short segment won't affect the resulting path much anyways so ignore it to avoid divide-by-zero.
if (Precision.AlmostEquals(timeDifference, 0))
continue;
maximumSlope = Math.Max(maximumSlope, xDifference / timeDifference);
}