add Debug.AddRect(AABB) function

GitOrigin-RevId: 0acfc3f43f9cc11d1c6925971f20ed6ed18cad61
This commit is contained in:
Colin McMillen 2020-01-29 15:42:13 -05:00
parent f1f717da63
commit 4410ff137a

View File

@ -66,6 +66,13 @@ namespace SemiColinGames {
rects.Add(new DebugRect(rect, color)); 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) { public static void AddLine(Point start, Point end, Color color) {
lines.Add(new DebugLine(start, end, color)); lines.Add(new DebugLine(start, end, color));
} }