Raytracer
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Raytracer::Core::Scene Class Reference
Inheritance diagram for Raytracer::Core::Scene:
Raytracer::Interfaces::IHittable

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.
 

Constructor & Destructor Documentation

◆ 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.

Parameters
objectThe object to add to the scene.
Returns
A new Scene object.

Member Function Documentation

◆ add()

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.

Parameters
objectThe object to add to the scene.
Returns
void

◆ boundingBox()

Raytracer::Utils::AxisAlignedBBox Raytracer::Core::Scene::boundingBox ( ) const
overridevirtual

Get the bounding box of the scene.

This function returns the bounding box of the scene.

Returns
The bounding box of the scene.

Implements Raytracer::Interfaces::IHittable.

◆ clear()

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.

Returns
void

◆ hit()

bool Raytracer::Core::Scene::hit ( const Core::Ray & ray,
Utils::Interval interval,
Core::Payload & payload ) const
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.

Parameters
rayThe ray to check for hits.
intervalThe interval to check for hits.
payloadThe payload to update with the hit information.
Returns
true if the ray hits anything in the scene, false otherwise.

Implements Raytracer::Interfaces::IHittable.


The documentation for this class was generated from the following files: