#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))
return *this;
}
-void
+void
Scene::Add(Primitive* p)
{
m_primitives.push_back(p);
void
Scene::Add(Light* l)
{
+ m_lights.push_back(l);
}
bool
{
intersect |= m_primitives[i]->Intersect(ray);
}
-
+
return intersect;
}
return (intersect) ? ray.hit()->shader()->Shade(ray) : m_bgColor;
}
-const Camera*
+const Camera*
Scene::camera() const
{
return m_camera;