Raytracer
|
Public Member Functions | |
Scene (std::shared_ptr< Interfaces::IHittable > object) | |
Construct a new Scene object. | |
void | clear () |
Clear the scene. | |
void | add (std::shared_ptr< Interfaces::IHittable > object) |
Add an object to the scene. | |
bool | hit (const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override |
Check if the ray hits anything in the scene. | |
Utils::AxisAlignedBBox | boundingBox () const override |
Get the bounding box of the scene. | |
Raytracer::Core::Scene::Scene | ( | std::shared_ptr< Interfaces::IHittable > | object | ) |
Construct a new Scene object.
This function constructs a new Scene object with the given object. The object is added to the list of objects in the scene. The bounding box of the scene is updated with the bounding box of the object.
object | The object to add to the scene. |
void Raytracer::Core::Scene::add | ( | std::shared_ptr< Interfaces::IHittable > | object | ) |
Add an object to the scene.
This function adds an object to the list of objects in the scene. The bounding box of the scene is updated with the bounding box of the object.
object | The object to add to the scene. |
|
overridevirtual |
Get the bounding box of the scene.
This function returns the bounding box of the scene.
Implements Raytracer::Interfaces::IHittable.
void Raytracer::Core::Scene::clear | ( | ) |
Clear the scene.
This function clears the list of objects in the scene. The bounding box of the scene is reset to the default value. The scene is empty after this function is called.
|
overridevirtual |
Check if the ray hits anything in the scene.
This function checks if the ray hits anything in the scene. The function returns true if the ray hits anything in the scene. The function returns false if the ray does not hit anything in the scene. The function updates the payload with the hit information.
ray | The ray to check for hits. |
interval | The interval to check for hits. |
payload | The payload to update with the hit information. |
Implements Raytracer::Interfaces::IHittable.