From d9e88babe21da3eccebb941384aeaf0264253825 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 4 Jun 2018 12:13:02 -0700 Subject: [PATCH] Fix CAABox::intersects --- include/zeus/CAABox.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/zeus/CAABox.hpp b/include/zeus/CAABox.hpp index f6d5aef..8f48d28 100644 --- a/include/zeus/CAABox.hpp +++ b/include/zeus/CAABox.hpp @@ -94,12 +94,12 @@ public: inline bool intersects(const CAABox& other) const { - bool x1 = (max[0] > other.min[0]); - bool x2 = (min[0] < other.max[0]); - bool y1 = (max[1] > other.min[1]); - bool y2 = (min[1] < other.max[1]); - bool z1 = (max[2] > other.min[2]); - bool z2 = (min[2] < other.max[2]); + bool x1 = (max[0] >= other.min[0]); + bool x2 = (min[0] <= other.max[0]); + bool y1 = (max[1] >= other.min[1]); + bool y2 = (min[1] <= other.max[1]); + bool z1 = (max[2] >= other.min[2]); + bool z2 = (min[2] <= other.max[2]); return x1 && x2 && y1 && y2 && z1 && z2; }