Raytracer
|
Public Member Functions | |
Cylinder (const Utils::Point3 ¢er, double radius, double height, std::shared_ptr< Interfaces::IMaterial > material) | |
Construct a new Cylinder object. | |
virtual bool | hit (const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override |
Check if the ray hits the cylinder. | |
virtual Utils::AxisAlignedBBox | boundingBox () const override |
Get the bounding box of the cylinder. | |
Raytracer::Shapes::Cylinder::Cylinder | ( | const Utils::Point3 & | center, |
double | radius, | ||
double | height, | ||
std::shared_ptr< Interfaces::IMaterial > | material ) |
Construct a new Cylinder object.
This function constructs a new Cylinder object with the given center, radius, height, and material. The cylinder is centered at the given center with the given radius, height, and material.
center | The center of the cylinder. |
radius | The radius of the cylinder. |
height | The height of the cylinder. |
material | The material of the cylinder. |
|
overridevirtual |
Get the bounding box of the cylinder.
This function returns the bounding box of the cylinder.
Implements Raytracer::Interfaces::IHittable.
|
overridevirtual |
Check if the ray hits the cylinder.
This function checks if the ray hits the cylinder. The function returns true if the ray hits the cylinder. The function returns false if the ray does not hit the cylinder. 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.