X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgeometry%2Fprimitive.hpp;h=c922506c40fa0e2281de5983bba01b11d36f8d90;hb=bda41b98427c8d34f954dae0dcaf261c5ad6cb43;hp=819ef04e77bd03e948b4c18fd051d817e610b69d;hpb=d220b0348951ce210ad4ea18dbe9934dd2999a60;p=gong.git diff --git a/src/geometry/primitive.hpp b/src/geometry/primitive.hpp index 819ef04..c922506 100644 --- a/src/geometry/primitive.hpp +++ b/src/geometry/primitive.hpp @@ -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 {