#ifndef RAY_TRACER_H_ #define RAY_TRACER_H_ #include "../external/json.hpp" #include "Geometry.h" #include "HitRecord.h" #include "Light.h" #include "Output.h" #include "Scene.h" #include using std::vector; class RayTracer { public: RayTracer(const nlohmann::json &j) : json(j) {} void run(); private: nlohmann::json json; vector scenes; vector lights; vector geometries; vector outputs; void parse(); void render(); Optional getHitRecord(Ray, const Geometry *) const; Optional getHitRecord(Ray) const; Vector3f calculateColor(const HitRecord &, int) const; Light *singleLightSource() const; Optional trace(Ray) const; Vector3f trace(HitRecord, int, float) const; }; #endif // !RAY_TRACER_H_