cloudy-raytracer/scene/simplescene.cpp
2022-11-05 22:08:16 +01:00

17 lines
431 B
C++

#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;
}