]> git.tdb.fi Git - libs/math.git/commitdiff
Adjust start_nesting in CompositeShape::get_intersections
authorMikko Rasa <tdb@tdb.fi>
Fri, 19 Aug 2016 23:24:20 +0000 (02:24 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 19 Aug 2016 23:24:20 +0000 (02:24 +0300)
The intersection points are coalesced to incrementally form a single
composite shape so start_nesting must follow suit.

source/geometry/compositeshape.h

index 0c2c838ec7d13364e6408872cc8dfad113ce5914..0f1dd437c99eee065de8d9720f05ce2573d1a90b 100644 (file)
@@ -179,6 +179,9 @@ inline unsigned CompositeShape<T, D, O>::get_intersections(const Ray<T, D> &ray,
                        return 0;
 
                n = k;
+
+               if(i!=shapes.begin())
+                       start_nesting = (start_nesting>!Ops::shortcircuit(false));
        }
 
        if(buffer!=points)