Raytracer
|
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. | |
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.
point | The point of the plane. |
normal | The normal of the plane. |
material | The material of the plane. |
|
overridevirtual |
Get the bounding box of the plane.
This function returns the bounding box of the plane.
Implements Raytracer::Interfaces::IHittable.
|
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.
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.