From: Mikko Rasa Date: Mon, 17 Apr 2017 19:27:29 +0000 (+0300) Subject: Fix composite shape ray intersection logic X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;ds=sidebyside;h=7de28b9c89ca4554f5c12746f481f5b385529479;hp=93e3f3af03f911396c678a2356a54dc9885b21f8;p=libs%2Fmath.git Fix composite shape ray intersection logic The test for start_nesting coalescence was written the wrong way, causing intersection shapes to return spurious hits when the ray started inside some part of the shape. Presumably union shapes did not return hits in some cases when they should. --- diff --git a/source/geometry/compositeshape.h b/source/geometry/compositeshape.h index 0f1dd43..e9aeadc 100644 --- a/source/geometry/compositeshape.h +++ b/source/geometry/compositeshape.h @@ -181,7 +181,7 @@ inline unsigned CompositeShape::get_intersections(const Ray &ray, n = k; if(i!=shapes.begin()) - start_nesting = (start_nesting>!Ops::shortcircuit(false)); + start_nesting = (start_nesting>!Ops::shortcircuit(true)); } if(buffer!=points)