From 8de737decd02e95ded4523a07ca86ea4d3aacb31 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 2 Aug 2014 14:30:40 -0700 Subject: [PATCH] Little bit of code clean up in TraceRay --- src/scene.cc | 8 ++++---- src/scene.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scene.cc b/src/scene.cc index 6587412..91c6d08 100644 --- a/src/scene.cc +++ b/src/scene.cc @@ -268,18 +268,18 @@ Scene::trace_ray(const Ray &ray, diffuse_level = shape_material.GetDiffuseIntensity(); ambient_level = 1.0 - diffuse_level; - shadow_ray = Ray(intersection, light_direction); + shadowRay = Ray(intersection, light_direction); for (Object::Ptr s : shapes) { - // Skip the intersected shape. if (s == intersected_shape) { + /* Skip the intersected shape. */ continue; } mStats.shadowRays++; - // Figure out if we're in shadow. + /* Figure out if we're in shadow. */ ts.clear(); - if (s->DoesIntersect(shadow_ray, ts)) { + if (s->DoesIntersect(shadowRay, ts)) { diffuse_level = 0.0; break; } diff --git a/src/scene.h b/src/scene.h index e66ab8c..bbdeffe 100644 --- a/src/scene.h +++ b/src/scene.h @@ -76,6 +76,7 @@ private: void PrintRayTable() const; + /* Ray counts */ unsigned long primaryRays; unsigned long shadowRays; unsigned long reflectionRays;