Raytracer
Loading...
Searching...
No Matches
Scene.hpp
1#include <vector>
2#include "Common.hpp"
3#include "interfaces/IHittable.hpp"
4
5#ifndef __SCENE_HPP__
6 #define __SCENE_HPP__
7
8namespace Raytracer::Core
9{
11 private:
13 std::vector<std::shared_ptr<Interfaces::IHittable>> _objects;
14
15 public:
16 Scene() = default;
17 Scene(std::shared_ptr<Interfaces::IHittable> object);
18 void clear();
19 void add(std::shared_ptr<Interfaces::IHittable> object);
20 bool hit(const Core::Ray &ray, Utils::Interval interval,
21 Core::Payload &payload) const override;
22 Utils::AxisAlignedBBox boundingBox() const override;
23 GET_SET(std::vector<std::shared_ptr<Interfaces::IHittable>>, objects)
24 };
25} // namespace Raytracer::Core
26
27#endif /* __SCENE_HPP__ */
Definition Payload.hpp:11
Definition Ray.hpp:9
Definition Scene.hpp:10
void clear()
Clear the scene.
Definition Scene.cpp:29
bool hit(const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
Check if the ray hits anything in the scene.
Definition Scene.cpp:65
void add(std::shared_ptr< Interfaces::IHittable > object)
Add an object to the scene.
Definition Scene.cpp:45
Utils::AxisAlignedBBox boundingBox() const override
Get the bounding box of the scene.
Definition Scene.cpp:91
Definition IHittable.hpp:11
Definition AxisAlignedBBox.hpp:10
Definition Interval.hpp:9