Raytracer
Loading...
Searching...
No Matches
Payload.hpp
1#include <memory>
2#include "core/Ray.hpp"
3#include "interfaces/IMaterial.hpp"
4#include "utils/VecN.hpp"
5
6#ifndef __PAYLOAD_HPP__
7 #define __PAYLOAD_HPP__
8
9namespace Raytracer::Core
10{
11 class Payload {
12 private:
13 Utils::Point3 _point;
14 Utils::Vec3 _normal;
15 std::shared_ptr<Interfaces::IMaterial> _material;
16 double _t;
17 double _u;
18 double _v;
19 bool _frontFace;
20
21 public:
22 Payload() = default;
23 void setFaceNormal(
24 const Core::Ray &ray, const Utils::Vec3 &outwardNormal);
25 GET_SET(Utils::Point3, point)
26 GET_SET(Utils::Vec3, normal)
27 GET_SET(std::shared_ptr<Interfaces::IMaterial>, material)
28 GET_SET(double, t)
29 GET_SET(double, u)
30 GET_SET(double, v)
31 GET_SET(bool, frontFace)
32 };
33} // namespace Raytracer::Core
34
35#endif /* __PAYLOAD_HPP__ */
Definition Payload.hpp:11
void setFaceNormal(const Core::Ray &ray, const Utils::Vec3 &outwardNormal)
Set the face normal based on the ray and the outward normal.
Definition Payload.cpp:16
Definition Ray.hpp:9
Definition VecN.hpp:40