void
Scene::Add(Primitive* p)
{
+ m_primitives.push_back(p);
}
bool
Scene::Intersect(Ray& ray)
{
- return false;
+ bool hit = false;
+ for( std::vector<Primitive*>::iterator i = m_primitives.begin();
+ i != m_primitives.end(); i++ ) {
+ hit |= (*i)->Intersect(ray);
+ }
+ return hit;
}
bool
Vec3f
Scene::RayTrace(Ray& ray)
{
- return Vec3f();
+ return (Intersect(ray)) ? Vec3f(255,255,255) : Vec3f(0,0,0);
}
const Camera*