some minor cleanups
continuous-integration/drone/push Build is passing Details

3D
Evan Hemsley 2020-07-18 13:19:36 -07:00
parent b152755481
commit e6bab0de5e
5 changed files with 10 additions and 5 deletions

View File

@ -26,11 +26,13 @@ namespace MoonTools.Bonk
public float Right { get { return Max.X; } } public float Right { get { return Max.X; } }
public float Left { get { return Min.X; } } public float Left { get { return Min.X; } }
/// <summary> /// <summary>
/// The top of the AABB. Assumes a downward-aligned Y axis, so this value will be smaller than Bottom. /// The top of the AABB. Assumes a downward-aligned Y axis, so this value will be smaller than Bottom.
/// </summary> /// </summary>
/// <value></value> /// <value></value>
public float Top { get { return Min.Y; } } public float Top { get { return Min.Y; } }
/// <summary> /// <summary>
/// The bottom of the AABB. Assumes a downward-aligned Y axis, so this value will be larger than Top. /// The bottom of the AABB. Assumes a downward-aligned Y axis, so this value will be larger than Top.
/// </summary> /// </summary>

View File

@ -4,6 +4,9 @@ using MoonTools.Structs;
namespace MoonTools.Bonk namespace MoonTools.Bonk
{ {
/// <summary>
/// A Point is "that which has not part". All points by themselves are identical.
/// </summary>
public struct Point : IShape2D, IEquatable<Point> public struct Point : IShape2D, IEquatable<Point>
{ {
public AABB AABB { get; } public AABB AABB { get; }

View File

@ -59,7 +59,7 @@ namespace MoonTools.Bonk
public bool Equals(IShape2D other) public bool Equals(IShape2D other)
{ {
return (other is Polygon otherPolygon && Equals(otherPolygon)); return other is Polygon otherPolygon && Equals(otherPolygon);
} }
public bool Equals(Polygon other) public bool Equals(Polygon other)

View File

@ -5,7 +5,7 @@ namespace MoonTools.Bonk
{ {
public struct SweepResult<T> where T : IEquatable<T> public struct SweepResult<T> where T : IEquatable<T>
{ {
public static SweepResult<T> False = new SweepResult<T>(); public readonly static SweepResult<T> False = new SweepResult<T>();
public bool Hit { get; } public bool Hit { get; }
public Vector2 Motion { get; } public Vector2 Motion { get; }