-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterial.h
47 lines (36 loc) · 1.22 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
// *********************************************************
// Material Class
// Author : Tamy Boubekeur ([email protected]).
// Copyright (C) 2010 Tamy Boubekeur.
// All rights reserved.
// *********************************************************
#ifndef MATERIAL_H
#define MATERIAL_H
#include <iostream>
#include <vector>
#include "Vec3D.h"
// Ce modèle suppose une couleur spéculaire blanche (1.0, 1.0, 1.0)
class Material {
public:
inline Material () : diffuse (0.8f), specular (0.2f), color (0.5f, 0.5f, 0.5f) {}
inline Material (float diffuse, float specular, const Vec3Df & color)
: diffuse (diffuse), specular (specular), color (color) {}
virtual ~Material () {}
inline float getDiffuse () const { return diffuse; }
inline float getSpecular () const { return specular; }
inline Vec3Df getColor () const { return color; }
inline void setDiffuse (float d) { diffuse = d; }
inline void setSpecular (float s) { specular = s; }
inline void setColor (const Vec3Df & c) { color = c; }
private:
float diffuse;
float specular;
Vec3Df color;
};
#endif // MATERIAL_H
// Some Emacs-Hints -- please don't remove:
//
// Local Variables:
// mode:C++
// tab-width:4
// End: