cloudy-raytracer/scene/simplescene.cpp

18 lines
431 B
C++
Raw Normal View History

2022-10-28 09:31:13 +02:00
#include "scene/simplescene.h"
#include "primitive/primitive.h"
#include "shader/shader.h"
bool SimpleScene::findIntersection(Ray &ray) const {
bool hit = false;
for (auto i : this->primitives())
hit |= i->intersect(ray);
return hit;
}
bool SimpleScene::findOcclusion(Ray &ray) const {
for (auto i : this->primitives())
if (i->intersect(ray) && !i->shader()->isTransparent())
return true;
return false;
}