mirror of https://github.com/ppy/osu
Calculate slider rotation using end point of path instead of EndPosition
This commit is contained in:
parent
0015f627b0
commit
031a977009
|
@ -339,13 +339,13 @@ private static Vector2 calculateCentreOfMass(Slider slider)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="slider">The slider to process.</param>
|
/// <param name="slider">The slider to process.</param>
|
||||||
/// <returns>The angle in radians.</returns>
|
/// <returns>The angle in radians.</returns>
|
||||||
private static float getSliderRotation(Slider slider)
|
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);
|
return (float)Math.Atan2(endPositionVector.Y, endPositionVector.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ public class ObjectPositionInfo
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The rotation of the hit object, relative to its jump angle.
|
/// 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.
|
/// For hit circles and spinners, this property is ignored.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float Rotation { get; set; }
|
public float Rotation { get; set; }
|
||||||
|
|
Loading…
Reference in New Issue