mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 02:22:55 +08:00
Adjust animations and tolerances to make things feel snappier
This commit is contained in:
parent
a039f9878a
commit
2ecab454aa
@ -51,15 +51,16 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
if (dragRotationState != DragRotationState.NotDragging)
|
if (dragRotationState != DragRotationState.NotDragging)
|
||||||
{
|
{
|
||||||
if (Vector2.Distance(positionMouseDown, e.MousePosition) > 100)
|
// make the rotation centre point floating.
|
||||||
positionMouseDown = Interpolation.ValueAt(0.001f, positionMouseDown, e.MousePosition, 0, Clock.ElapsedFrameTime);
|
if (Vector2.Distance(positionMouseDown, e.MousePosition) > 60)
|
||||||
|
positionMouseDown = Interpolation.ValueAt(0.005f, positionMouseDown, e.MousePosition, 0, Clock.ElapsedFrameTime);
|
||||||
|
|
||||||
var position = e.MousePosition;
|
var position = e.MousePosition;
|
||||||
float distance = Vector2Extensions.Distance(position, positionMouseDown);
|
float distance = Vector2Extensions.Distance(position, positionMouseDown);
|
||||||
|
|
||||||
// don't start rotating until we're moved a minimum distance away from the mouse down location,
|
// don't start rotating until we're moved a minimum distance away from the mouse down location,
|
||||||
// else it can have an annoying effect.
|
// else it can have an annoying effect.
|
||||||
if (dragRotationState == DragRotationState.DragStarted && distance > 30)
|
if (dragRotationState == DragRotationState.DragStarted && distance > 80)
|
||||||
dragRotationState = DragRotationState.Rotating;
|
dragRotationState = DragRotationState.Rotating;
|
||||||
|
|
||||||
// don't rotate when distance is zero to avoid NaN
|
// don't rotate when distance is zero to avoid NaN
|
||||||
@ -74,7 +75,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
if (diff > 180) diff -= 360;
|
if (diff > 180) diff -= 360;
|
||||||
degrees = activeCursor.Rotation + diff;
|
degrees = activeCursor.Rotation + diff;
|
||||||
|
|
||||||
activeCursor.RotateTo(degrees, 600, Easing.OutQuint);
|
activeCursor.RotateTo(degrees, 120, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
|
|
||||||
if (dragRotationState != DragRotationState.NotDragging)
|
if (dragRotationState != DragRotationState.NotDragging)
|
||||||
{
|
{
|
||||||
activeCursor.RotateTo(0, 600 * (1 + Math.Abs(activeCursor.Rotation / 720)), Easing.OutElasticHalf);
|
activeCursor.RotateTo(0, 400 * (0.5f + Math.Abs(activeCursor.Rotation / 960)), Easing.OutElasticQuarter);
|
||||||
dragRotationState = DragRotationState.NotDragging;
|
dragRotationState = DragRotationState.NotDragging;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user