Raytracer
|
Public Member Functions | |
Cone (const Utils::Point3 ¢er, 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. | |
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.
center | The center of the cone. |
radius | The radius of the cone. |
height | The height of the cone. |
material | The material of the cone. |
|
overridevirtual |
Get the bounding box of the cone.
This function returns the bounding box of the cone.
Implements Raytracer::Interfaces::IHittable.
|
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.
ray | The ray to check for hits. |
interval | The interval to check for hits. |
payload | The payload to update with the hit information. |
Implements Raytracer::Interfaces::IHittable.