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

Public Member Functions

 Cone (const Utils::Point3 &center, double radius, double height, std::shared_ptr< Interfaces::IMaterial > material)
 Construct a new Cone object.
 
virtual bool hit (const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
 Check if the ray hits the cone.
 
virtual Utils::AxisAlignedBBox boundingBox () const override
 Get the bounding box of the cone.
 

Constructor & Destructor Documentation

◆ Cone()

Raytracer::Shapes::Cone::Cone ( const Utils::Point3 & center,
double radius,
double height,
std::shared_ptr< Interfaces::IMaterial > material )

Construct a new Cone object.

This function constructs a new Cone object with the given center, radius, height, and material. The cone is centered at the given center with the given radius, height, and material.

Parameters
centerThe center of the cone.
radiusThe radius of the cone.
heightThe height of the cone.
materialThe material of the cone.
Returns
A new Cone object.

Member Function Documentation

◆ boundingBox()

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

Get the bounding box of the cone.

This function returns the bounding box of the cone.

Returns
The bounding box of the cone.

Implements Raytracer::Interfaces::IHittable.

◆ hit()

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

Check if the ray hits the cone.

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

Implements Raytracer::Interfaces::IHittable.


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