cgv
Loading...
Searching...
No Matches
phong_material.cxx
1#include "phong_material.h"
2
3namespace cgv {
4 namespace media {
5 namespace illum {
6
7 phong_material::phong_material() : ambient(0.1f,0.1f,0.1f,1), diffuse(0.5f,0.5f,0.5f,1), specular(0.5f, 0.5f, 0.5f,1), emission(0,0,0,1), shininess(50.0f) {}
8 void phong_material::set_ambient(const color_type& c) { ambient = c; }
9 void phong_material::set_diffuse(const color_type& c) { diffuse = c; }
10 void phong_material::set_specular(const color_type& c) { specular = c; }
11 void phong_material::set_emission(const color_type& c) { emission = c; }
12 void phong_material::set_shininess(float s) { shininess = s; }
13 const phong_material::color_type& phong_material::get_ambient() const { return ambient; }
14 const phong_material::color_type& phong_material::get_diffuse() const { return diffuse; }
15 const phong_material::color_type& phong_material::get_specular() const { return specular; }
16 const phong_material::color_type& phong_material::get_emission() const { return emission; }
17 float phong_material::get_shininess() const { return shininess; }
18 phong_material::color_type& phong_material::ref_ambient() { return ambient; }
19 phong_material::color_type& phong_material::ref_diffuse() { return diffuse; }
20 phong_material::color_type& phong_material::ref_specular() { return specular; }
21 phong_material::color_type& phong_material::ref_emission() { return emission; }
22 float& phong_material::ref_shininess() { return shininess; }
23
24 const phong_material& default_material() { static phong_material mat; return mat; }
25
26 }
27 }
28}
color< float, RGB, OPACITY > color_type
>used color type
color_type ambient
>ambient color component
color_type emission
>emissive color component
color_type diffuse
>diffuse color component
color_type specular
>specular color component
phong_material()
construct default material
float shininess
>exponent of the specular cosine term
the cgv namespace
Definition print.h:11