mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
parse scenes
This commit is contained in:
parent
2f4d439e97
commit
03b6bbbb8e
2 changed files with 20 additions and 4 deletions
|
@ -1,9 +1,17 @@
|
|||
#include "RayTracer.h"
|
||||
#include "../external/simpleppm.h"
|
||||
#include "Parser.h"
|
||||
#include "Scene.h"
|
||||
|
||||
void RayTracer::parse() {
|
||||
for (auto i = json["output"].begin(); i != json["output"].end(); ++i)
|
||||
scenes.push_back(Parser::getScene(*i));
|
||||
}
|
||||
|
||||
void RayTracer::render() {}
|
||||
|
||||
void RayTracer::output() {}
|
||||
|
||||
void RayTracer::run() {
|
||||
nlohmann::json sceneJson = this->json["output"][0];
|
||||
Scene *sc = Parser::getScene(sceneJson);
|
||||
parse();
|
||||
render();
|
||||
output();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
#define RAY_TRACER_H_
|
||||
|
||||
#include "../external/json.hpp"
|
||||
#include "Scene.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RayTracer {
|
||||
public:
|
||||
|
@ -10,6 +13,11 @@ public:
|
|||
|
||||
private:
|
||||
nlohmann::json json;
|
||||
std::vector<Scene *> scenes;
|
||||
|
||||
void parse();
|
||||
void render();
|
||||
void output();
|
||||
};
|
||||
|
||||
#endif // !RAY_TRACER_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue