mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Improve rotation handling in edge cases
This commit is contained in:
parent
a39188f762
commit
f4cda695e6
@ -101,17 +101,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float aimRotation = MathHelper.RadiansToDegrees(
|
float aimRotation = MathHelper.RadiansToDegrees((float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X));
|
||||||
(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;
|
Rotation = aimRotation;
|
||||||
hasRotation = true;
|
hasRotation = true;
|
||||||
}
|
}
|
||||||
else
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user