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
This commit is contained in:
Josh Holtrop 2009-02-27 22:29:27 +00:00
parent 27cea5e702
commit 5af3f0deca

View File

@ -33,7 +33,7 @@ Shape::IntersectionList Union::intersect(refptr<Shape> _this, const Ray & ray)
in1 = true; in1 = true;
else else
in2 = true; in2 = true;
if (!in_bool && in1 && in2) if (!in_bool && (in1 || in2))
{ {
/* we found an intersection point with the boolean object */ /* we found an intersection point with the boolean object */
in_bool = true; in_bool = true;
@ -42,16 +42,16 @@ Shape::IntersectionList Union::intersect(refptr<Shape> _this, const Ray & ray)
} }
else else
{ {
if (in_bool && in1 && in2)
{
/* we found an intersection point with the boolean object */
res.add( merged[i].intersection );
}
if (left) if (left)
in1 = false; in1 = false;
else else
in2 = false; 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;
}
} }
} }