From 4b856420f962d3e8e02a7b2f8201ac8b82379e9d Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sat, 5 Apr 2025 15:06:26 +0300 Subject: [PATCH] docs: improved documentation no Shape2D --- Engine.Core/Primitives/Shape2D.cs | 69 ++++++++++++++++--------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/Engine.Core/Primitives/Shape2D.cs b/Engine.Core/Primitives/Shape2D.cs index 19866c7..366cc88 100644 --- a/Engine.Core/Primitives/Shape2D.cs +++ b/Engine.Core/Primitives/Shape2D.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; + using Syntriax.Engine.Core.Abstract; namespace Syntriax.Engine.Core; @@ -9,7 +10,7 @@ namespace Syntriax.Engine.Core; /// /// The vertices of the shape. /// -/// Initializes a new instance of the struct with the specified vertices. +/// Initializes a new instance of a struct with the specified vertices. /// [System.Diagnostics.DebuggerDisplay("Vertices Count: {Vertices.Count}")] public readonly struct Shape2D(List vertices) : IEnumerable @@ -22,7 +23,7 @@ public readonly struct Shape2D(List vertices) : IEnumerable private readonly List _verticesList = vertices; /// - /// Gets the vertices of the shape. + /// Gets the vertices of the . /// public IReadOnlyList Vertices => _verticesList; @@ -34,10 +35,10 @@ public readonly struct Shape2D(List vertices) : IEnumerable public Vector2D this[System.Index index] => Vertices[index]; /// - /// Returns a copy of the current shape. + /// Returns a copy of the current . /// - /// The shape to copy. - /// A copy of the input shape. + /// The to copy. + /// A copy of the input . public static Shape2D CreateCopy(Shape2D shape) => new(new List(shape.Vertices)); /// @@ -69,10 +70,10 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Gets the super triangle that encloses the given shape. + /// Gets the super triangle that encloses the given . /// - /// The shape to enclose. - /// The super triangle that encloses the given shape. + /// The to enclose. + /// The super triangle that encloses the given . public static Triangle GetSuperTriangle(Shape2D shape) { float minX = float.MaxValue, minY = float.MaxValue; @@ -100,9 +101,9 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Triangulates the given convex shape. + /// Triangulates the given convex . /// - /// The shape to triangulate. + /// The to triangulate. /// The list to populate with triangles. public static void TriangulateConvex(Shape2D shape, IList triangles) { @@ -113,9 +114,9 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Triangulates the given convex shape. + /// Triangulates the given convex . /// - /// The shape to triangulate. + /// The to triangulate. /// A list of s that makes up the given convex . public static List TriangulateConvex(Shape2D shape) { @@ -125,10 +126,10 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Gets the lines that form the edges of the shape. + /// Gets the s that form the edges of the . /// - /// The shape to get lines from. - /// The list to populate with lines. + /// The to get s from. + /// The list to populate with . public static void GetLines(Shape2D shape, IList lines) { lines.Clear(); @@ -138,10 +139,10 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Gets a list of lines that form the edges of the shape. + /// Gets a list of s that form the edges of the . /// - /// The shape to get lines from. - /// A list of lines that form the edges of the shape. + /// The shape to get s from. + /// A list of s that form the edges of the . public static List GetLines(Shape2D shape) { List lines = new(shape.Vertices.Count - 1); @@ -150,7 +151,7 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Projects the shape onto a vector. + /// Projects the onto a 1D plane. /// /// The shape to project. /// The vector to project onto. @@ -165,11 +166,11 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Projects the shape onto a vector. + /// Projects the onto a vector. /// - /// The shape to project. + /// The to project. /// The vector to project onto. - /// The projection of the shape onto the vector. + /// The projection of the onto the vector. public static Projection1D Project(Shape2D shape, Vector2D projectionVector) { float min = float.MaxValue; @@ -186,11 +187,11 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Transforms the shape using the specified transform. + /// Transforms the using the specified . /// - /// The shape to transform. - /// The transform to apply. - /// The transformed shape. + /// The to transform. + /// The to apply. + /// The transformed . public static Shape2D TransformShape(Shape2D shape, ITransform2D transform) { List vertices = new(shape.Vertices.Count); @@ -203,11 +204,11 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Transforms the shape using the specified transform. + /// Transforms the using the specified . /// - /// The shape to transform. - /// The transform to apply. - /// The transformed shape. + /// The to transform. + /// The to apply. + /// The transformed . public static void TransformShape(Shape2D from, ITransform2D transform, ref Shape2D to) { to._verticesList.Clear(); @@ -218,12 +219,12 @@ public readonly struct Shape2D(List vertices) : IEnumerable } /// - /// Determines whether two shapes are approximately equal. + /// Determines whether two s are approximately equal. /// - /// The first shape to compare. - /// The second shape to compare. + /// The first to compare. + /// The second to compare. /// The epsilon range. - /// true if the shapes are approximately equal; otherwise, false. + /// true if the s are approximately equal; otherwise, false. public static bool ApproximatelyEquals(Shape2D left, Shape2D right, float epsilon = float.Epsilon) { if (left.Vertices.Count != right.Vertices.Count)