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