-
Notifications
You must be signed in to change notification settings - Fork 0
/
Geometry.h
61 lines (48 loc) · 1.29 KB
/
Geometry.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "Material.h"
#include "Vector.h"
#include "Line.h"
#include "Intersection.h"
#ifndef RT_GEOMETRY_INCLUDED
#define RT_GEOMETRY_INCLUDED
namespace rt {
class Geometry {
private:
Color _color;
Material _material;
public:
Geometry() {
_material = Material();
_color = Color();
}
Geometry(const Material& material) {
_material = Material(material);
_color = Color();
}
Geometry(const Color& color) {
_material = Material();
_color = Color(color);
}
Geometry(const Geometry& geometry) {
_material = Material(geometry.material());
_color = Color(geometry.color());
}
virtual ~Geometry() {
}
virtual Intersection getIntersection(const Line& line,
float minDist,
float maxDist) {
Intersection in(false, this, &line, 0);
return in;
};
inline const Material& material() const {
return _material;
}
inline const Color& color() const {
return _color;
}
virtual inline const Vector normal(const Vector& vec) const {
return Vector(1, 0, 0);
}
};
}
#endif