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

Public Member Functions

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

Constructor & Destructor Documentation

◆ RotateX()

Raytracer::Effects::RotateX::RotateX ( std::shared_ptr< Interfaces::IHittable > object,
double angle )

Construct a new RotateX object.

This function constructs a new RotateX object with the given object and angle. The object is rotated around the x-axis by the given angle. The bounding box of the object is updated with the rotated bounding box.

Parameters
objectThe object to rotate.
angleThe angle to rotate the object by.
Returns
A new RotateX object.

Member Function Documentation

◆ boundingBox()

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

Get the bounding box of the rotated object.

This function returns the bounding box of the rotated object.

Returns
The bounding box of the rotated object.

Implements Raytracer::Interfaces::IHittable.

◆ hit()

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

Check if the ray hits the rotated object.

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

Implements Raytracer::Interfaces::IHittable.


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