Calculate slider rotation using end point of path instead of EndPosition

This commit is contained in:
Henry Lin 2022-04-01 11:50:30 +08:00
parent 0015f627b0
commit 031a977009
1 changed files with 3 additions and 3 deletions

View File

@ -339,13 +339,13 @@ private static Vector2 calculateCentreOfMass(Slider slider)
}
/// <summary>
/// Get the absolute rotation of a slider, defined as the angle from its start position to its end position.
/// Get the absolute rotation of a slider, defined as the angle from its start position to the end of its path.
/// </summary>
/// <param name="slider">The slider to process.</param>
/// <returns>The angle in radians.</returns>
private static float getSliderRotation(Slider slider)
{
var endPositionVector = slider.EndPosition - slider.Position;
var endPositionVector = slider.Path.PositionAt(1);
return (float)Math.Atan2(endPositionVector.Y, endPositionVector.X);
}
@ -373,7 +373,7 @@ public class ObjectPositionInfo
/// <summary>
/// The rotation of the hit object, relative to its jump angle.
/// For sliders, this is defined as the angle from the slider's start position to its end position, relative to its jump angle.
/// For sliders, this is defined as the angle from the slider's start position to the end of its path, relative to its jump angle.
/// For hit circles and spinners, this property is ignored.
/// </summary>
public float Rotation { get; set; }