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

Public Member Functions

 Quad (const Utils::Point3 &Q, const Utils::Vec3 &u, const Utils::Vec3 &v, std::shared_ptr< Interfaces::IMaterial > material)
 Construct a new Quad object.
 
bool hit (const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
 Check if the ray hits the quad.
 
Utils::AxisAlignedBBox boundingBox () const override
 Get the bounding box of the quad.
 
virtual void setBBox ()
 Set the bounding box of the quad.
 
virtual bool isInterior (double a, double b, Core::Payload &payload) const
 Check if the point is inside the quad.
 

Constructor & Destructor Documentation

◆ Quad()

Raytracer::Shapes::Quad::Quad ( const Utils::Point3 & Q,
const Utils::Vec3 & u,
const Utils::Vec3 & v,
std::shared_ptr< Interfaces::IMaterial > material )

Construct a new Quad object.

This function constructs a new Quad object with the given point, u, v, and material. The quad is centered at the given point with the given u, v, and material.

Parameters
QThe point of the quad.
uThe u vector of the quad.
vThe v vector of the quad.
materialThe material of the quad.
Returns
A new Quad object.

Member Function Documentation

◆ boundingBox()

Raytracer::Utils::AxisAlignedBBox Raytracer::Shapes::Quad::boundingBox ( ) const
overridevirtual

Get the bounding box of the quad.

This function returns the bounding box of the quad.

Returns
The bounding box of the quad.

Implements Raytracer::Interfaces::IHittable.

◆ hit()

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

Check if the ray hits the quad.

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

Implements Raytracer::Interfaces::IHittable.

◆ isInterior()

bool Raytracer::Shapes::Quad::isInterior ( double a,
double b,
Core::Payload & payload ) const
virtual

Check if the point is inside the quad.

This function checks if the point is inside the quad. The function returns true if the point is inside the quad. The function returns false if the point is not inside the quad. The function updates the payload with the u and v values of the point.

Parameters
aThe alpha value of the point.
bThe beta value of the point.
payloadThe payload to update with the u and v values.
Returns
True if the point is inside the quad, false otherwise.

◆ setBBox()

void Raytracer::Shapes::Quad::setBBox ( )
virtual

Set the bounding box of the quad.

This function sets the bounding box of the quad.


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