mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Make slider control points relative to start position
This commit is contained in:
@ -23,8 +23,8 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity;
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
public Vector2 StackedPositionAt(double t) => this.PositionAt(t) + StackOffset;
|
||||
public override Vector2 EndPosition => this.PositionAt(1);
|
||||
public Vector2 StackedPositionAt(double t) => StackedPosition + this.PositionAt(t);
|
||||
public override Vector2 EndPosition => Position + this.PositionAt(1);
|
||||
|
||||
public SliderCurve Curve { get; } = new SliderCurve();
|
||||
|
||||
@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
HeadCircle = new HitCircle
|
||||
{
|
||||
StartTime = StartTime,
|
||||
Position = this.PositionAt(0),
|
||||
Position = Position,
|
||||
IndexInCurrentCombo = IndexInCurrentCombo,
|
||||
ComboColour = ComboColour,
|
||||
Samples = Samples,
|
||||
@ -109,7 +109,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
TailCircle = new HitCircle
|
||||
{
|
||||
StartTime = EndTime,
|
||||
Position = this.PositionAt(1),
|
||||
Position = EndPosition,
|
||||
IndexInCurrentCombo = IndexInCurrentCombo,
|
||||
ComboColour = ComboColour
|
||||
};
|
||||
@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
SpanIndex = span,
|
||||
SpanStartTime = spanStartTime,
|
||||
StartTime = spanStartTime + timeProgress * SpanDuration,
|
||||
Position = Curve.PositionAt(distanceProgress) - Curve.PositionAt(0),
|
||||
Position = Position + Curve.PositionAt(distanceProgress),
|
||||
StackHeight = StackHeight,
|
||||
Scale = Scale,
|
||||
ComboColour = ComboColour,
|
||||
@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
RepeatIndex = repeatIndex,
|
||||
SpanDuration = SpanDuration,
|
||||
StartTime = StartTime + repeat * SpanDuration,
|
||||
Position = Curve.PositionAt(repeat % 2) - Curve.PositionAt(0),
|
||||
Position = Position + Curve.PositionAt(repeat % 2),
|
||||
StackHeight = StackHeight,
|
||||
Scale = Scale,
|
||||
ComboColour = ComboColour,
|
||||
@ -184,10 +184,4 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SliderExtensions
|
||||
{
|
||||
public static Vector2 PositionAt(this Slider slider, double progress)
|
||||
=> ((IHasCurve)slider).PositionAt(progress) - slider.Curve.PositionAt(0);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user