I was a little to hasty with this clean up

I actually need this check to get the closest shape for intersection.
This commit is contained in:
Eryn Wells 2014-08-03 13:05:22 -07:00
parent 4cbe9df324
commit 556e13ae74

View file

@ -228,8 +228,10 @@ Scene::trace_ray(const Ray &ray,
for (Object::Ptr s : shapes) {
ts.clear();
if (s->DoesIntersect(ray, ts, mStats)) {
intersected_shape = s;
nearest_t = ts[0];
if (ts[0] < nearest_t) {
intersected_shape = s;
nearest_t = ts[0];
}
}
}