mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 18:12:56 +08:00
RotationAbsolute -> BidirectionalRotation
This commit is contained in:
parent
f51ff55328
commit
3d8b27abfa
@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
if (auto && !userTriggered && Time.Current > Spinner.StartTime + Spinner.Duration / 2 && Progress < 1)
|
if (auto && !userTriggered && Time.Current > Spinner.StartTime + Spinner.Duration / 2 && Progress < 1)
|
||||||
{
|
{
|
||||||
// force completion only once to not break human interaction
|
// force completion only once to not break human interaction
|
||||||
Disc.RotationAbsolute = Spinner.SpinsRequired * 360;
|
Disc.BidirectionalRotation = Spinner.SpinsRequired * 360;
|
||||||
auto = false;
|
auto = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -136,7 +137,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
positionBindable.BindTo(HitObject.PositionBindable);
|
positionBindable.BindTo(HitObject.PositionBindable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float Progress => MathHelper.Clamp(Disc.RotationAbsolute / 360 / Spinner.SpinsRequired, 0, 1);
|
public float Progress => MathHelper.Clamp(Disc.BidirectionalRotation / 360 / Spinner.SpinsRequired, 0, 1);
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
@ -188,7 +189,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
circle.Rotation = Disc.Rotation;
|
circle.Rotation = Disc.Rotation;
|
||||||
Ticks.Rotation = Disc.Rotation;
|
Ticks.Rotation = Disc.Rotation;
|
||||||
spmCounter.SetRotation(Disc.RotationAbsolute);
|
spmCounter.SetRotation(Disc.BidirectionalRotation);
|
||||||
|
|
||||||
float relativeCircleScale = Spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight;
|
float relativeCircleScale = Spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight;
|
||||||
Disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint);
|
Disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint);
|
||||||
|
@ -82,11 +82,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
private float lastAngle;
|
private float lastAngle;
|
||||||
private float currentRotation;
|
private float currentRotation;
|
||||||
public float RotationAbsolute;
|
public float BidirectionalRotation;
|
||||||
private int completeTick;
|
private int completeTick;
|
||||||
|
|
||||||
private bool updateCompleteTick() => completeTick != (completeTick = (int)(RotationAbsolute / 360));
|
|
||||||
|
|
||||||
|
private bool updateCompleteTick() => completeTick != (completeTick = (int)(BidirectionalRotation / 360));
|
||||||
private bool rotationTransferred;
|
private bool rotationTransferred;
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
lastAngle -= 360;
|
lastAngle -= 360;
|
||||||
|
|
||||||
currentRotation += thisAngle - lastAngle;
|
currentRotation += thisAngle - lastAngle;
|
||||||
RotationAbsolute += Math.Abs(thisAngle - lastAngle);
|
BidirectionalRotation += Math.Abs(thisAngle - lastAngle) * Math.Sign(Time.Current - lastTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastAngle = thisAngle;
|
lastAngle = thisAngle;
|
||||||
|
Loading…
Reference in New Issue
Block a user