Raytracer
Loading...
Searching...
No Matches
Cylinder.hpp
1#include <memory>
2#include "interfaces/IHittable.hpp"
3#include "interfaces/IMaterial.hpp"
4
5#ifndef __CYLINDER_HPP__
6 #define __CYLINDER_HPP__
7
8namespace Raytracer::Shapes
9{
11 private:
12 Utils::Point3 _center;
13 double _radius;
14 double _height;
15 std::shared_ptr<Interfaces::IMaterial> _material;
17
18 public:
19 Cylinder() = default;
20 Cylinder(const Utils::Point3 &center, double radius, double height,
21 std::shared_ptr<Interfaces::IMaterial> material);
22 virtual bool hit(const Core::Ray &ray, Utils::Interval interval,
23 Core::Payload &payload) const override;
24 virtual Utils::AxisAlignedBBox boundingBox() const override;
25 };
26} // namespace Raytracer::Shapes
27
28#endif /* __CYLINDER_HPP__ */
Definition Payload.hpp:11
Definition Ray.hpp:9
Definition IHittable.hpp:11
Definition Cylinder.hpp:10
virtual Utils::AxisAlignedBBox boundingBox() const override
Get the bounding box of the cylinder.
Definition Cylinder.cpp:125
virtual bool hit(const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
Check if the ray hits the cylinder.
Definition Cylinder.cpp:40
Definition AxisAlignedBBox.hpp:10
Definition Interval.hpp:9
Definition VecN.hpp:40