diff --git a/Engine.Physics2D/Primitives/AABB.cs b/Engine.Physics2D/Primitives/AABB.cs index 6c48d36..5da1cc1 100644 --- a/Engine.Physics2D/Primitives/AABB.cs +++ b/Engine.Physics2D/Primitives/AABB.cs @@ -6,6 +6,10 @@ namespace Syntriax.Engine.Physics2D.Primitives; public record AABB(Vector2D LowerBoundary, Vector2D UpperBoundary) { + public Vector2D Center => (LowerBoundary + UpperBoundary) * .5f; + public Vector2D Size => LowerBoundary.FromTo(UpperBoundary).Abs(); + public Vector2D SizeHalf => Size * .5f; + public static AABB FromVectors(IEnumerable vectors) { int counter = 0;