mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 07:43:01 +08:00
Cast less.
This commit is contained in:
parent
9114c9dec4
commit
785ae892f4
@ -54,10 +54,11 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
progress = MathHelper.Clamp(progress, 0, 1);
|
progress = MathHelper.Clamp(progress, 0, 1);
|
||||||
|
|
||||||
double index = progress * (calculatedPath.Count - 1);
|
double index = progress * (calculatedPath.Count - 1);
|
||||||
|
int flooredIndex = (int)index;
|
||||||
|
|
||||||
Vector2 pos = calculatedPath[(int)index];
|
Vector2 pos = calculatedPath[flooredIndex];
|
||||||
if (index != (int)index)
|
if (index != flooredIndex)
|
||||||
pos += (calculatedPath[(int)index + 1] - pos) * (float)(index - (int)index);
|
pos += (calculatedPath[flooredIndex + 1] - pos) * (float)(index - flooredIndex);
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user