-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ray.hpp
36 lines (30 loc) · 1018 Bytes
/
Ray.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __RAY__
#define __RAY__
#include <memory>
#include <limits>
#include "shapes/Shape.hpp"
#include "materials/Material.hpp"
#include "Scene.hpp"
#include "AreaLight.hpp"
#include "globals.hpp"
using ShapePtr = shared_ptr<Shape>;
using namespace std;
//Maximum float value
const float MAX_float = numeric_limits<float>::max();
//***********************************************************************
// Ray implementation
//***********************************************************************
class Ray{
private:
Point origin;
Direction dir;
public:
Direction getDirection();
void setDirection(Direction dir);
void setOrigin(Point origin);
int findIntersectionWith(ShapePtr shape, float solutions[]);
RGB getRayResult(Scene& scene);
bool getShadowRayResult(Scene& scene, RGB& initial, LightPoint destination, ShapePtr lastShape);
Event castShadowRays(Scene& scene, RGB& initial, Point origin, ShapePtr lastShape);
};
#endif