From 2f341aaeae07d2cb9b8f9be0ff5688543dcd582b Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 16 Sep 2020 12:59:10 -0700 Subject: [PATCH] corners method --- Bonk/AABB3D.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Bonk/AABB3D.cs b/Bonk/AABB3D.cs index 90d0e03..b3e2e93 100644 --- a/Bonk/AABB3D.cs +++ b/Bonk/AABB3D.cs @@ -49,6 +49,18 @@ namespace MoonTools.Bonk ); } + public IEnumerable AABBCorners() + { + yield return Min; + yield return new Vector3(Min.X, Min.Y, Max.Z); + yield return new Vector3(Min.X, Max.Y, Min.Z); + yield return new Vector3(Max.X, Min.Y, Min.Z); + yield return new Vector3(Min.X, Max.Y, Max.Z); + yield return new Vector3(Max.X, Min.Y, Max.Z); + yield return new Vector3(Max.X, Max.Y, Min.Z); + yield return Max; + } + public override bool Equals(object obj) { return obj is AABB3D d && Equals(d);