mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 15:47:38 +09:00
Update RPM calculation for readability
Multiply the 1.01 factor to the resulting RPM, not to the duration.
This commit is contained in:
parent
585bd541f3
commit
df9535d195
@ -45,7 +45,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
// for that reason using ElapsedFrameTime directly leads to fewer SPM with Half Time and more SPM with Double Time.
|
||||
// for spinners we want the real (wall clock) elapsed time; to achieve that, unapply the clock rate locally here.
|
||||
double rateIndependentElapsedTime = spinner.Clock.ElapsedFrameTime / spinner.Clock.Rate;
|
||||
float rotationSpeed = (float)(spinner.HitObject.SpinsRequired / (spinner.HitObject.Duration / 1.01));
|
||||
|
||||
// multiply the SPM by 1.01 to ensure that the spinner is completed. if the calculation is left exact,
|
||||
// some spinners may not complete due to very minor decimal loss during calculation
|
||||
float rotationSpeed = (float)(1.01 * spinner.HitObject.SpinsRequired / spinner.HitObject.Duration);
|
||||
spinner.RotationTracker.AddRotation(MathUtils.RadiansToDegrees((float)rateIndependentElapsedTime * rotationSpeed * MathF.PI * 2.0f));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user