-
Notifications
You must be signed in to change notification settings - Fork 0
/
Material.cpp
46 lines (39 loc) · 1.61 KB
/
Material.cpp
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
/**
* \author Marie DARRIGOL & Anthony LEONARD & Ophélie PELLOUX-PRAYER & Olivier SOLDANO
* \project Ray-Tracing
* \file material.cpp
* \brief represent a material associated with a sceneObject
*/
#include "Material.h"
Material::Material():
phong_ambiant_factor(.2f),
phong_diffuse_factor (1.0f),
phong_specular_factor (1.0f),
phong_specular_alpha(100.0f),
color(Vec3()),
bump_map (Image()),
refractive_index ( 0.0f){}
Material::Material(float ref_index) : Material(){
refractive_index = ref_index;
}
Material::Material(float amb, float diff, float spec, float alpha, Color color): phong_ambiant_factor(amb),
phong_diffuse_factor(diff),
phong_specular_factor(spec),
phong_specular_alpha(alpha),
color(color),
refractive_index(0.0f){}
Material::Material(float amb, float diff, float spec, float alpha, Color color, float refr) : phong_ambiant_factor(amb),
phong_diffuse_factor(diff),
phong_specular_factor(spec),
phong_specular_alpha(alpha),
color(color),
refractive_index(refr){}
Material::Material(float amb, float diff, float spec, float alpha, Color color, const char* file): phong_ambiant_factor(amb),
phong_diffuse_factor(diff),
phong_specular_factor(spec),
phong_specular_alpha(alpha),
color(color),
bump_map(),
refractive_index(0.0f) {
bump_map.readPPM(file);
}