]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/intersection.h
Optimize bounding box bisection with more early culling
[libs/math.git] / source / geometry / intersection.h
index 0e555b03f7086185076ca904512605b0ae204e08..24e668dc35a1924a70e1c3815fecbeac8147595e 100644 (file)
@@ -10,6 +10,7 @@ template<typename T, unsigned D>
 struct IntersectionOps
 {
        static BoundingBox<T, D> combine_aabb(const BoundingBox<T, D> &a, const BoundingBox<T, D> &b) { return a&b; }
+       static Coverage combine_coverage(Coverage a, Coverage b) { return ((a==PARTIAL_COVERAGE && b==a) ? UNCERTAIN_COVERAGE : std::min(a, b)); }
        static bool shortcircuit(bool c) { return !c; }
 };