From 33b141eb3aaea7228a013a18a138a7a12454b966 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 30 Aug 2019 10:14:52 +1000 Subject: [PATCH] geom/aabb: add an aabb/point intersection test --- geom/aabb.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/geom/aabb.hpp b/geom/aabb.hpp index 95415c2e..86c18dbd 100644 --- a/geom/aabb.hpp +++ b/geom/aabb.hpp @@ -169,6 +169,14 @@ namespace cruft::geom { typedef aabb<3,float> aabb3f; typedef aabb<3,unsigned> aabb3u; typedef aabb<3,int> aabb3i; + + + template + bool + intersects (aabb const &a, point const &b) noexcept + { + return a.inclusive (b); + } }