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

Public Member Functions

 Translate (std::shared_ptr< Interfaces::IHittable > object, const Utils::Vec3 &offset)
 Construct a new Translate object.
 
bool hit (const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
 Check if the ray hits the translated object.
 
Utils::AxisAlignedBBox boundingBox () const override
 Get the bounding box of the translated object.
 

Constructor & Destructor Documentation

◆ Translate()

Raytracer::Effects::Translate::Translate ( std::shared_ptr< Interfaces::IHittable > object,
const Utils::Vec3 & offset )

Construct a new Translate object.

This function constructs a new Translate object with the given object and offset. The object is translated by the given offset.

Parameters
objectThe object to translate.
offsetThe offset to translate the object by.
Returns
A new Translate object.

Member Function Documentation

◆ boundingBox()

Raytracer::Utils::AxisAlignedBBox Raytracer::Effects::Translate::boundingBox ( ) const
overridevirtual

Get the bounding box of the translated object.

This function returns the bounding box of the translated object.

Returns
The bounding box of the translated object.

Implements Raytracer::Interfaces::IHittable.

◆ hit()

bool Raytracer::Effects::Translate::hit ( const Core::Ray & ray,
Utils::Interval interval,
Core::Payload & payload ) const
overridevirtual

Check if the ray hits the translated object.

This function checks if the ray hits the translated object. The function returns true if the ray hits the translated object. The function returns false if the ray does not hit the translated object. 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 the translated object, false otherwise.

Implements Raytracer::Interfaces::IHittable.


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