From 5af3f0decaea84baceab87ea63bf9c261162a0bd Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 27 Feb 2009 22:29:27 +0000 Subject: [PATCH] i think i have union working, need to test after transparency is working git-svn-id: svn://anubis/fart/trunk@157 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- shapes/Union.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shapes/Union.cc b/shapes/Union.cc index 4f1eca4..a3257f9 100644 --- a/shapes/Union.cc +++ b/shapes/Union.cc @@ -33,7 +33,7 @@ Shape::IntersectionList Union::intersect(refptr _this, const Ray & ray) in1 = true; else in2 = true; - if (!in_bool && in1 && in2) + if (!in_bool && (in1 || in2)) { /* we found an intersection point with the boolean object */ in_bool = true; @@ -42,16 +42,16 @@ Shape::IntersectionList Union::intersect(refptr _this, const Ray & ray) } else { - if (in_bool && in1 && in2) - { - /* we found an intersection point with the boolean object */ - res.add( merged[i].intersection ); - } if (left) in1 = false; else in2 = false; - in_bool = false; + if (in_bool && !(in1 || in2)) + { + /* we found an intersection point with the boolean object */ + res.add( merged[i].intersection ); + in_bool = false; + } } }