From f4cda695e6b3fc43b2034a8af22f33e06265bb39 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 18:50:59 +0900 Subject: [PATCH] Improve rotation handling in edge cases --- .../Objects/Drawables/DrawableRepeatPoint.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 77f813ae1e..27ec6cc529 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -101,17 +101,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; } - float aimRotation = MathHelper.RadiansToDegrees( - (float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); + float aimRotation = MathHelper.RadiansToDegrees((float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); + while (Math.Abs(aimRotation - Rotation) > 180) + aimRotation += aimRotation < Rotation ? 360 : -360; - if (!hasRotation || Math.Abs(aimRotation - Rotation) > 180) + if (!hasRotation) { Rotation = aimRotation; hasRotation = true; } else { - Rotation = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 100), Rotation, aimRotation, 0, 600, Easing.OutQuint); + Rotation = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 100), Rotation, aimRotation, 0, 50, Easing.OutQuint); } } }