-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmaterial.h
53 lines (37 loc) · 1.06 KB
/
material.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
#ifndef TMPL8_2018_01_MATERIAL_H
#define TMPL8_2018_01_MATERIAL_H
#include "precomp.h"
enum MaterialType {diffuse, textured, reflective, snell, fresnel, beer, light, phong};
class Material {
public:
int phongFactor = 50;
float emission = 0;
MaterialType getMaterialType() {
return mt;
};
void setMaterialType(MaterialType mt) { this->mt = mt; };
Material(MaterialType mt);
Material(MaterialType mt, int texture);
Material(MaterialType mt, float v);
Material(MaterialType mt, float v, vec3 a);
Material(MaterialType mt, bool tri);
Material() = default;
float getSpecularity();
void setSpecularity(float sp);
float getIndex();
void setIndex(float index);
vec3 getAbsorbtion();
void setAbsorbtion(vec3 a);
int getTexture();
void setTexture(int index);
void setEmission(float e);
void setPhongFactor(int p);
bool isTriangle = false;
private:
MaterialType mt;
float specularity;
float refractiveIndex;
vec3 absorbtion;
int textureIndex;
};
#endif //TMPL8_2018_01_MATERIAL_H