1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Add xmldoc

This commit is contained in:
Henry Lin 2022-04-01 11:49:27 +08:00
parent c0a78924aa
commit 0015f627b0

View File

@ -316,6 +316,11 @@ namespace osu.Game.Rulesets.Osu.Utils
); );
} }
/// <summary>
/// Estimate the centre of mass of a slider relative to its start position.
/// </summary>
/// <param name="slider">The slider to process.</param>
/// <returns>The centre of mass of the slider.</returns>
private static Vector2 calculateCentreOfMass(Slider slider) private static Vector2 calculateCentreOfMass(Slider slider)
{ {
if (slider.Distance < 1) return Vector2.Zero; if (slider.Distance < 1) return Vector2.Zero;
@ -333,6 +338,11 @@ namespace osu.Game.Rulesets.Osu.Utils
return sum / count; return sum / count;
} }
/// <summary>
/// Get the absolute rotation of a slider, defined as the angle from its start position to its end position.
/// </summary>
/// <param name="slider">The slider to process.</param>
/// <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.EndPosition - slider.Position;