/
UIMaterial.h
59 lines (47 loc) · 1.49 KB
/
UIMaterial.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
54
55
56
57
58
59
#pragma once
#include "UIClass.h"
/**
* Material concept: "Anything graphical applied to the polygons"
*
* @author Diederick Huijbers <diederick[at]apollomedia[dot]nl>
*
* @link Wavefront material file spec:
* http://people.sc.fsu.edu/~jburkardt/data/mtl/mtl.html
* @link Ogre3D
* http://www.ogre3d.org/docs/manual/manual_11.html#SEC14
* @link assim material
* http://assimp.sourceforge.net/lib_html/ai_material_8h.html#7dd415ff703a2cc53d1c22ddbbd7dde0
*/
class UIMaterial : public UIClass {
public:
UIMaterial();
UIMaterial( string _name );
virtual ~UIMaterial();
void set(ofMaterial &_mat);
void setName( string _name );
void setColors(ofFloatColor oDiffuse, ofFloatColor oAmbient, ofFloatColor oSpecular, ofFloatColor oEmissive);
void operator = (ofMaterial &_mat);
string getClassName();
// apply the material
virtual void begin();
virtual void end();
aColor diffuse;
aColor ambient;
aColor specular;
aColor emissive;
protected:
void setupUI();
void guiEvent(ofxUIEventArgs &e);
string name;
// ofFloatColor diffuse;
// ofFloatColor ambient;
// ofFloatColor specular;
// ofFloatColor emissive;
ofFloatColor prev_diffuse, prev_diffuse_back;
ofFloatColor prev_ambient, prev_ambient_back;
ofFloatColor prev_specular, prev_specular_back;
ofFloatColor prev_emissive, prev_emissive_back;
float prev_shininess, prev_shininess_back;
float shininess;
};
typedef shared_ptr<UIMaterial> UIMaterialReference;