From 7d75f045fea4a3a769ea71e53a45b733ecaa091a Mon Sep 17 00:00:00 2001 From: Rtch90 <ritchie.cunningham@protonmail.com> Date: Sun, 18 Feb 2018 21:32:47 +0000 Subject: [PATCH] [Add] Axis-Aligned bounding box update. Getting ready to begin new collision framework. --- src/aabb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/aabb.h b/src/aabb.h index 408564f..0bdd8bd 100644 --- a/src/aabb.h +++ b/src/aabb.h @@ -4,5 +4,13 @@ struct Aabb { vector3d max, min; + void Update(vector3d p) { + if(max.x < p.x) max.x = p.x; + if(max.y < p.y) max.y = p.y; + if(max.z < p.z) max.z = p.z; + if(min.x > p.x) min.x = p.x; + if(min.y > p.y) min.y = p.y; + if(min.z > p.z) min.z = p.z; + } };