1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Rename RateAdjustedRotation to TotalRotation

This commit is contained in:
Dean Herbert 2023-10-16 18:25:03 +09:00
parent 84be714d6b
commit 159b24acf7
No known key found for this signature in database
7 changed files with 15 additions and 15 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}); });
AddStep("rotate some", () => dho.RotationTracker.AddRotation(180)); AddStep("rotate some", () => dho.RotationTracker.AddRotation(180));
AddAssert("rotation is set", () => dho.Result.RateAdjustedRotation == 180); AddAssert("rotation is set", () => dho.Result.TotalRotation == 180);
AddStep("apply new spinner", () => dho.Apply(prepareObject(new Spinner AddStep("apply new spinner", () => dho.Apply(prepareObject(new Spinner
{ {
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.Tests
Duration = 1000, Duration = 1000,
}))); })));
AddAssert("rotation is reset", () => dho.Result.RateAdjustedRotation == 0); AddAssert("rotation is reset", () => dho.Result.TotalRotation == 0);
} }
private Spinner prepareObject(Spinner circle) private Spinner prepareObject(Spinner circle)

View File

@ -63,11 +63,11 @@ namespace osu.Game.Rulesets.Osu.Tests
trackerRotationTolerance = Math.Abs(drawableSpinner.RotationTracker.Rotation * 0.1f); trackerRotationTolerance = Math.Abs(drawableSpinner.RotationTracker.Rotation * 0.1f);
}); });
AddAssert("is disc rotation not almost 0", () => drawableSpinner.RotationTracker.Rotation, () => Is.Not.EqualTo(0).Within(100)); AddAssert("is disc rotation not almost 0", () => drawableSpinner.RotationTracker.Rotation, () => Is.Not.EqualTo(0).Within(100));
AddAssert("is disc rotation absolute not almost 0", () => drawableSpinner.Result.RateAdjustedRotation, () => Is.Not.EqualTo(0).Within(100)); AddAssert("is disc rotation absolute not almost 0", () => drawableSpinner.Result.TotalRotation, () => Is.Not.EqualTo(0).Within(100));
addSeekStep(0); addSeekStep(0);
AddAssert("is disc rotation almost 0", () => drawableSpinner.RotationTracker.Rotation, () => Is.EqualTo(0).Within(trackerRotationTolerance)); AddAssert("is disc rotation almost 0", () => drawableSpinner.RotationTracker.Rotation, () => Is.EqualTo(0).Within(trackerRotationTolerance));
AddAssert("is disc rotation absolute almost 0", () => drawableSpinner.Result.RateAdjustedRotation, () => Is.EqualTo(0).Within(100)); AddAssert("is disc rotation absolute almost 0", () => drawableSpinner.Result.TotalRotation, () => Is.EqualTo(0).Within(100));
} }
[Test] [Test]
@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Osu.Tests
finalTrackerRotation = drawableSpinner.RotationTracker.Rotation; finalTrackerRotation = drawableSpinner.RotationTracker.Rotation;
trackerRotationTolerance = Math.Abs(finalTrackerRotation * 0.05f); trackerRotationTolerance = Math.Abs(finalTrackerRotation * 0.05f);
}); });
AddStep("retrieve cumulative disc rotation", () => finalCumulativeTrackerRotation = drawableSpinner.Result.RateAdjustedRotation); AddStep("retrieve cumulative disc rotation", () => finalCumulativeTrackerRotation = drawableSpinner.Result.TotalRotation);
addSeekStep(spinner_start_time + 2500); addSeekStep(spinner_start_time + 2500);
AddAssert("disc rotation rewound", AddAssert("disc rotation rewound",
@ -92,13 +92,13 @@ namespace osu.Game.Rulesets.Osu.Tests
() => drawableSpinner.RotationTracker.Rotation, () => Is.EqualTo(finalTrackerRotation / 2).Within(trackerRotationTolerance)); () => drawableSpinner.RotationTracker.Rotation, () => Is.EqualTo(finalTrackerRotation / 2).Within(trackerRotationTolerance));
AddAssert("is cumulative rotation rewound", AddAssert("is cumulative rotation rewound",
// cumulative rotation is not damped, so we're treating it as the "ground truth" and allowing a comparatively smaller margin of error. // cumulative rotation is not damped, so we're treating it as the "ground truth" and allowing a comparatively smaller margin of error.
() => drawableSpinner.Result.RateAdjustedRotation, () => Is.EqualTo(finalCumulativeTrackerRotation / 2).Within(100)); () => drawableSpinner.Result.TotalRotation, () => Is.EqualTo(finalCumulativeTrackerRotation / 2).Within(100));
addSeekStep(spinner_start_time + 5000); addSeekStep(spinner_start_time + 5000);
AddAssert("is disc rotation almost same", AddAssert("is disc rotation almost same",
() => drawableSpinner.RotationTracker.Rotation, () => Is.EqualTo(finalTrackerRotation).Within(trackerRotationTolerance)); () => drawableSpinner.RotationTracker.Rotation, () => Is.EqualTo(finalTrackerRotation).Within(trackerRotationTolerance));
AddAssert("is cumulative rotation almost same", AddAssert("is cumulative rotation almost same",
() => drawableSpinner.Result.RateAdjustedRotation, () => Is.EqualTo(finalCumulativeTrackerRotation).Within(100)); () => drawableSpinner.Result.TotalRotation, () => Is.EqualTo(finalCumulativeTrackerRotation).Within(100));
} }
[Test] [Test]
@ -135,7 +135,7 @@ namespace osu.Game.Rulesets.Osu.Tests
{ {
// multipled by 2 to nullify the score multiplier. (autoplay mod selected) // multipled by 2 to nullify the score multiplier. (autoplay mod selected)
long totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2; long totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2;
return totalScore == (int)(drawableSpinner.Result.RateAdjustedRotation / 360) * new SpinnerTick().CreateJudgement().MaxNumericResult; return totalScore == (int)(drawableSpinner.Result.TotalRotation / 360) * new SpinnerTick().CreateJudgement().MaxNumericResult;
}); });
addSeekStep(0); addSeekStep(0);

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Judgements
/// If Double Time is active instead (with a speed multiplier of 1.5x), /// If Double Time is active instead (with a speed multiplier of 1.5x),
/// in the same scenario the property will return 720 * 1.5 = 1080. /// in the same scenario the property will return 720 * 1.5 = 1080.
/// </example> /// </example>
public float RateAdjustedRotation; public float TotalRotation;
/// <summary> /// <summary>
/// Time instant at which the spin was started (the first user input which caused an increase in spin). /// Time instant at which the spin was started (the first user input which caused an increase in spin).

View File

@ -218,7 +218,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
// these become implicitly hit. // these become implicitly hit.
return 1; return 1;
return Math.Clamp(Result.RateAdjustedRotation / 360 / HitObject.SpinsRequired, 0, 1); return Math.Clamp(Result.TotalRotation / 360 / HitObject.SpinsRequired, 0, 1);
} }
} }
@ -279,7 +279,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
// don't update after end time to avoid the rate display dropping during fade out. // don't update after end time to avoid the rate display dropping during fade out.
// this shouldn't be limited to StartTime as it causes weirdness with the underlying calculation, which is expecting updates during that period. // this shouldn't be limited to StartTime as it causes weirdness with the underlying calculation, which is expecting updates during that period.
if (Time.Current <= HitObject.EndTime) if (Time.Current <= HitObject.EndTime)
spmCalculator.SetRotation(Result.RateAdjustedRotation); spmCalculator.SetRotation(Result.TotalRotation);
updateBonusScore(); updateBonusScore();
} }
@ -293,7 +293,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
if (ticks.Count == 0) if (ticks.Count == 0)
return; return;
int spins = (int)(Result.RateAdjustedRotation / 360); int spins = (int)(Result.TotalRotation / 360);
if (spins < completedFullSpins) if (spins < completedFullSpins)
{ {

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{ {
get get
{ {
int rotations = (int)(drawableSpinner.Result.RateAdjustedRotation / 360); int rotations = (int)(drawableSpinner.Result.TotalRotation / 360);
if (wholeRotationCount == rotations) return false; if (wholeRotationCount == rotations) return false;

View File

@ -200,7 +200,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{ {
get get
{ {
int rotations = (int)(drawableSpinner.Result.RateAdjustedRotation / 360); int rotations = (int)(drawableSpinner.Result.TotalRotation / 360);
if (wholeRotationCount == rotations) return false; if (wholeRotationCount == rotations) return false;

View File

@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
currentRotation += angle; currentRotation += angle;
// rate has to be applied each frame, because it's not guaranteed to be constant throughout playback // rate has to be applied each frame, because it's not guaranteed to be constant throughout playback
// (see: ModTimeRamp) // (see: ModTimeRamp)
drawableSpinner.Result.RateAdjustedRotation += (float)(Math.Abs(angle) * (gameplayClock?.GetTrueGameplayRate() ?? Clock.Rate)); drawableSpinner.Result.TotalRotation += (float)(Math.Abs(angle) * (gameplayClock?.GetTrueGameplayRate() ?? Clock.Rate));
} }
private void resetState(DrawableHitObject obj) private void resetState(DrawableHitObject obj)