solution for 3.1a)
[MicroTrace.git] / Scene.cxx
index bbd6785..a1d3acd 100644 (file)
--- a/Scene.cxx
+++ b/Scene.cxx
@@ -2,11 +2,11 @@
 #include "PerspectiveCamera.hxx"
 
 Scene::Scene()
-  : m_camera(new PerspectiveCamera(Vec3f(0,0,8), 
-                                  Vec3f(0,0,-1), 
-                                  Vec3f(0,1,0), 
-                                  50, 
-                                  640, 
+  : m_camera(new PerspectiveCamera(Vec3f(0,0,8),
+                                  Vec3f(0,0,-1),
+                                  Vec3f(0,1,0),
+                                  50,
+                                  640,
                                   480)
             ),
     m_bgColor(Vec3f(0,0,0))
@@ -29,7 +29,7 @@ Scene::operator=(const Scene& s)
   return *this;
 }
 
-void 
+void
 Scene::Add(Primitive* p)
 {
   m_primitives.push_back(p);
@@ -38,6 +38,7 @@ Scene::Add(Primitive* p)
 void
 Scene::Add(Light* l)
 {
+  m_lights.push_back(l);
 }
 
 bool
@@ -49,7 +50,7 @@ Scene::Intersect(Ray& ray)
     {
       intersect |= m_primitives[i]->Intersect(ray);
     }
-  
+
   return intersect;
 }
 
@@ -66,7 +67,7 @@ Scene::RayTrace(Ray& ray)
   return (intersect) ? ray.hit()->shader()->Shade(ray) : m_bgColor;
 }
 
-const Camera* 
+const Camera*
 Scene::camera() const
 {
   return m_camera;
This page took 0.024205 seconds and 4 git commands to generate.