mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
rewrite Scene class
This commit is contained in:
parent
9fcdfd2773
commit
630967a07f
2 changed files with 37 additions and 20 deletions
27
src/Scene.cc
27
src/Scene.cc
|
@ -1,18 +1,17 @@
|
|||
#include "Scene.h"
|
||||
|
||||
Scene::Scene(const nlohmann::json &output) {
|
||||
for (auto i = output.begin(); i != output.end(); ++i) {
|
||||
if (i->contains("filename")) {
|
||||
this->name = (*i)["filename"].get<string>();
|
||||
}
|
||||
|
||||
if (i->contains("size")) {
|
||||
this->width = (*i)["size"].at(0).get<int>();
|
||||
this->height = (*i)["size"].at(1).get<int>();
|
||||
}
|
||||
}
|
||||
void Scene::setRaysPerPixel(const Eigen::VectorXi &raysPerPixel) {
|
||||
this->raysPerPixel = raysPerPixel;
|
||||
}
|
||||
|
||||
string Scene::getName() { return this->name; }
|
||||
int Scene::getWidth() { return this->width; }
|
||||
int Scene::getHeight() { return this->height; }
|
||||
void Scene::setAntialiasing(bool antialiasing) {
|
||||
this->antialiasing = antialiasing;
|
||||
}
|
||||
|
||||
void Scene::setTwoSideRender(bool twoSideRender) {
|
||||
this->twoSideRender = twoSideRender;
|
||||
}
|
||||
|
||||
void Scene::setGlobalIllum(bool globalIllum) {
|
||||
this->globalIllum = globalIllum;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue