mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 18:32:54 +08:00
3278a1d7d8
There were two coordinate systems used: - 0..512 (used in osu!stable) - 0..1 (relative coordinate) This commit replaces the usage of the relative coordinate system to the coordinate system of 0..512.
44 lines
1.7 KiB
C#
44 lines
1.7 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System;
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Difficulty.Preprocessing
|
|
{
|
|
public class CatchDifficultyHitObject : DifficultyHitObject
|
|
{
|
|
private const float normalized_hitobject_radius = 41.0f;
|
|
|
|
public new CatchHitObject BaseObject => (CatchHitObject)base.BaseObject;
|
|
|
|
public new CatchHitObject LastObject => (CatchHitObject)base.LastObject;
|
|
|
|
public readonly float NormalizedPosition;
|
|
public readonly float LastNormalizedPosition;
|
|
|
|
/// <summary>
|
|
/// Milliseconds elapsed since the start time of the previous <see cref="CatchDifficultyHitObject"/>, with a minimum of 40ms.
|
|
/// </summary>
|
|
public readonly double StrainTime;
|
|
|
|
public readonly double ClockRate;
|
|
|
|
public CatchDifficultyHitObject(HitObject hitObject, HitObject lastObject, double clockRate, float halfCatcherWidth)
|
|
: base(hitObject, lastObject, clockRate)
|
|
{
|
|
// We will scale everything by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
var scalingFactor = normalized_hitobject_radius / halfCatcherWidth;
|
|
|
|
NormalizedPosition = BaseObject.X * scalingFactor;
|
|
LastNormalizedPosition = LastObject.X * scalingFactor;
|
|
|
|
// Every strain interval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure
|
|
StrainTime = Math.Max(40, DeltaTime);
|
|
ClockRate = clockRate;
|
|
}
|
|
}
|
|
}
|