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