]> git.localhorst.tv Git - gong.git/blobdiff - src/geometry/primitive.hpp
simple AABB intersection test
[gong.git] / src / geometry / primitive.hpp
index 819ef04e77bd03e948b4c18fd051d817e610b69d..c922506c40fa0e2281de5983bba01b11d36f8d90 100644 (file)
@@ -30,10 +30,17 @@ struct AABB {
                glm::vec3 high(glm::max(glm::abs(min), glm::abs(max)));
                return glm::length(high);
        }
+
+       void Move(const glm::vec3 &delta) noexcept {
+               min += delta;
+               max += delta;
+       }
 };
 
 std::ostream &operator <<(std::ostream &, const AABB &);
 
+bool Intersection(const AABB &, const AABB &) noexcept;
+
 // TODO: this should really use setters/getters for dir and inv_dir so
 //       manipulating code doesn't "forget" to call Update()
 struct Ray {