Subtract working, but reflected normals being returned... and where did my plane and cyl go?
git-svn-id: svn://anubis/fart/trunk@159 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
ef25fe4a5b
commit
5035c80d94
4 files changed
+41
-28
No files matched your search
+13
-23
@@ -26,31 +26,21 @@ Shape::IntersectionList Subtract::intersect(refptr<Shape> _this, const Ray & ray
|
||||
double dot = - (ray.getDirection() % normal);
|
||||
bool front = dot > 0.0;
|
||||
bool left = merged[i].left;
|
||||
if (front)
|
||||
{
|
||||
if (left)
|
||||
in1 = true;
|
||||
else
|
||||
in2 = true;
|
||||
if (!in_bool && in1 && !in2)
|
||||
{
|
||||
/* we found an intersection point with the boolean object */
|
||||
in_bool = true;
|
||||
res.add( merged[i].intersection );
|
||||
}
|
||||
}
|
||||
if (left)
|
||||
in1 = front;
|
||||
else
|
||||
in2 = front;
|
||||
if (!in_bool && in1 && !in2)
|
||||
{
|
||||
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;
|
||||
}
|
||||
/* we found an intersection point with the boolean object */
|
||||
in_bool = true;
|
||||
res.add( merged[i].intersection );
|
||||
}
|
||||
else if (in_bool && !(in1 && !in2))
|
||||
{
|
||||
/* we found an intersection point with the boolean object */
|
||||
res.add( merged[i].intersection );
|
||||
in_bool = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user