diff --git a/geom/segment.cpp b/geom/segment.cpp index aba65fed..48974ce9 100644 --- a/geom/segment.cpp +++ b/geom/segment.cpp @@ -8,6 +8,7 @@ #include "segment.hpp" +#include "aabb.hpp" #include "ops.hpp" #include "../region.hpp" @@ -66,3 +67,15 @@ cruft::geom::intersects (cruft::geom::segment2i seg, cruft::region2i rect) { return intersects (seg.cast (), rect.cast ()); } + + +/////////////////////////////////////////////////////////////////////////////// +template <> +cruft::geom::aabb3f +cruft::geom::bounds (cruft::geom::segment3f obj) +{ + return { + min (obj.a, obj.b), + max (obj.a, obj.b), + }; +}