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

Public Member Functions

 Plane (const Utils::Point3 &point, const Utils::Vec3 &normal, std::shared_ptr< Interfaces::IMaterial > material)
 Construct a new Plane object.
 
bool hit (const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
 Check if the ray hits the plane.
 
Utils::AxisAlignedBBox boundingBox () const override
 Get the bounding box of the plane.
 

Constructor & Destructor Documentation

◆ Plane()

Raytracer::Shapes::Plane::Plane ( const Utils::Point3 & point,
const Utils::Vec3 & normal,
std::shared_ptr< Interfaces::IMaterial > material )

Construct a new Plane object.

This function constructs a new Plane object with the given point, normal, and material. The plane is centered at the given point with the given normal and material.

Parameters
pointThe point of the plane.
normalThe normal of the plane.
materialThe material of the plane.
Returns
A new Plane object.

Member Function Documentation

◆ boundingBox()

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

Get the bounding box of the plane.

This function returns the bounding box of the plane.

Returns
The bounding box of the plane.

Implements Raytracer::Interfaces::IHittable.

◆ hit()

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

Check if the ray hits the plane.

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

Implements Raytracer::Interfaces::IHittable.


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