Raytracer
Loading...
Searching...
No Matches
Quad.hpp
1#include <memory>
2#include "core/Scene.hpp"
3#include "interfaces/IHittable.hpp"
4
5#ifndef __QUAD_HPP__
6 #define __QUAD_HPP__
7
8namespace Raytracer::Shapes
9{
10 class Quad : public Interfaces::IHittable {
11 private:
13 Utils::Vec3 _u;
14 Utils::Vec3 _v;
15 Utils::Vec3 _w;
16 std::shared_ptr<Interfaces::IMaterial> _material;
18 Utils::Vec3 _normal;
19 double _D;
20
21 public:
22 Quad(const Utils::Point3 &Q, const Utils::Vec3 &u,
23 const Utils::Vec3 &v,
24 std::shared_ptr<Interfaces::IMaterial> material);
25 bool hit(const Core::Ray &ray, Utils::Interval interval,
26 Core::Payload &payload) const override;
27 Utils::AxisAlignedBBox boundingBox() const override;
28 virtual void setBBox();
29 virtual bool isInterior(
30 double a, double b, Core::Payload &payload) const;
31 };
32
33 std::shared_ptr<Core::Scene> box(const Utils::Point3 &a,
34 const Utils::Point3 &b,
35 std::shared_ptr<Interfaces::IMaterial> material);
36} // namespace Raytracer::Shapes
37
38#endif /* __QUAD_HPP__ */
Definition Payload.hpp:11
Definition Ray.hpp:9
Definition IHittable.hpp:11
Definition Quad.hpp:10
bool hit(const Core::Ray &ray, Utils::Interval interval, Core::Payload &payload) const override
Check if the ray hits the quad.
Definition Quad.cpp:43
virtual bool isInterior(double a, double b, Core::Payload &payload) const
Check if the point is inside the quad.
Definition Quad.cpp:113
virtual void setBBox()
Set the bounding box of the quad.
Definition Quad.cpp:91
Utils::AxisAlignedBBox boundingBox() const override
Get the bounding box of the quad.
Definition Quad.cpp:81
Quad(const Utils::Point3 &Q, const Utils::Vec3 &u, const Utils::Vec3 &v, std::shared_ptr< Interfaces::IMaterial > material)
Construct a new Quad object.
Definition Quad.cpp:18
Definition AxisAlignedBBox.hpp:10
Definition Interval.hpp:9
Definition VecN.hpp:40