From e08dcffcd12cf85b6377c4c2352fa08007132705 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 23 Mar 2017 19:29:46 -1000 Subject: [PATCH] Add CAABox subscript operator --- include/zeus/CAABox.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/zeus/CAABox.hpp b/include/zeus/CAABox.hpp index 0c100cb..e562fcd 100644 --- a/include/zeus/CAABox.hpp +++ b/include/zeus/CAABox.hpp @@ -351,6 +351,14 @@ public: } inline bool invalid() { return (max.x < min.x || max.y < min.y || max.z < min.z); } + + inline float operator[](size_t idx) const + { + if (idx < 3) + return min[idx]; + else + return max[idx-3]; + } }; inline bool operator==(const CAABox& left, const CAABox& right)