-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaterial.h
More file actions
54 lines (46 loc) · 1.82 KB
/
Material.h
File metadata and controls
54 lines (46 loc) · 1.82 KB
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
//
// Created by Bray, Matthew D ERDC-RDE-GSL-MS CIV on 11/19/22.
//
#ifndef RAYCASTER_MATERIAL_H
#define RAYCASTER_MATERIAL_H
#include "Color.h"
#include "Pattern.h"
class Material {
public:
Material() : color(Color(1, 1, 1)),
ambient(0.1), diffuse(0.9), specular(0.9), shininess(200.0),
reflective(0.0), transparency(0.0), refractive_index(1.0),
pattern(nullptr) {};
Material(const Color& color, float ambient, float diffuse, float specular, float shininess, float reflective, float transparency, float refractive_index, std::shared_ptr<Pattern> pattern) :
color(color), ambient(ambient), diffuse(diffuse), specular(specular), shininess(shininess), reflective(reflective), transparency(transparency), refractive_index(refractive_index), pattern(nullptr) {};
Color color;
float ambient;
float diffuse;
float specular;
float shininess;
float reflective;
float transparency;
float refractive_index;
std::shared_ptr<Pattern> pattern = nullptr;
// Equality
bool operator==(const Material& rhs) const {
return (color == rhs.color && is_equal(ambient, rhs.ambient) && is_equal(diffuse, rhs.diffuse) && is_equal(specular, rhs.specular) && is_equal(shininess, rhs.shininess));
}
};
// Glass material
//inline Material glass() {
// return Material(Color(1.0, 1.0, 1.0), 0.0, 0.5, 0.5, 200.0, 0.0, 1.0, 1.5, nullptr);
//}
const Material glass
{
Colors::BLACK, // color
0, // ambient
0, // diffuse
1, // specular
300, // shininess
0.9, // reflective
1, // transparency
1.5, // refractive index
nullptr // pattern
};
#endif //RAYCASTER_MATERIAL_H