fixed bug in shapes/Plane which would return negative results, fixed bug in main/Scene which would not check for shape to be non-null after calling getRayClosestHit()
git-svn-id: svn://anubis/fart/trunk@161 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
c78e5941c8
commit
9ef826df43
4 files changed
+50
-44
No files matched your search
+5
-2
@@ -38,8 +38,11 @@ Shape::IntersectionList Plane::intersect(refptr<Shape> _this, const Ray & ray)
|
||||
Solver::Result solutions = solver.solve();
|
||||
if (solutions.numResults > 0)
|
||||
{
|
||||
Vector isect_point = ray_inv[solutions.results[0]];
|
||||
res.add(Intersection(_this, m_transform.transform_point(isect_point)));
|
||||
if (solutions.results[0] > 0.0)
|
||||
{
|
||||
Vector isect_point = ray_inv[solutions.results[0]];
|
||||
res.add(Intersection(_this, m_transform.transform_point(isect_point)));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user