From 4410ff137afbe3412fd00345505e0daf160cc852 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Wed, 29 Jan 2020 15:42:13 -0500 Subject: [PATCH] add Debug.AddRect(AABB) function GitOrigin-RevId: 0acfc3f43f9cc11d1c6925971f20ed6ed18cad61 --- Shared/Debug.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Shared/Debug.cs b/Shared/Debug.cs index 00b044a..0310784 100644 --- a/Shared/Debug.cs +++ b/Shared/Debug.cs @@ -66,6 +66,13 @@ namespace SemiColinGames { rects.Add(new DebugRect(rect, color)); } + public static void AddRect(Aabb box, Color color) { + Rectangle rect = new Rectangle( + (int) (box.Position.X - box.HalfSize.X), (int) (box.Position.Y - box.HalfSize.Y), + (int) (box.HalfSize.X * 2), (int) (box.HalfSize.Y * 2)); + AddRect(rect, color); + } + public static void AddLine(Point start, Point end, Color color) { lines.Add(new DebugLine(start, end, color)); }