Syntriax.Engine/Engine.Physics2D/Primitives/AABB.cs

15 lines
503 B
C#
Raw Normal View History

using Syntriax.Engine.Core;
namespace Syntriax.Engine.Physics2D.Primitives;
public record AABB(Vector2D LowerBoundary, Vector2D UpperBoundary)
{
2024-01-23 19:13:51 +03:00
public static bool ApproximatelyEquals(AABB left, AABB right)
=> left.LowerBoundary.ApproximatelyEquals(right.LowerBoundary) && left.UpperBoundary.ApproximatelyEquals(right.UpperBoundary);
}
2024-01-23 19:13:51 +03:00
public static class AABBExtensions
{
public static bool ApproximatelyEquals(this AABB left, AABB right) => AABB.ApproximatelyEquals(left, right);
}