Subversion Repositories gelsvn

Rev

Rev 153 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 153 Rev 156
1
#ifndef __MATERIAL_H__
1
#ifndef __MATERIAL_H__
2
#define __MATERIAL_H__
2
#define __MATERIAL_H__
3
 
3
 
4
#include <string>
4
#include <string>
5
#include <vector>
5
#include <vector>
6
#include "CGLA/Vec3f.h"
6
#include "CGLA/Vec3f.h"
7
#include "CGLA/Vec3i.h"
7
#include "CGLA/Vec3i.h"
8
 
8
 
9
namespace GLGraphics
9
namespace Geometry
10
{
10
{
11
		struct Material
11
		struct Material
12
		{
12
		{
13
				std::string name;			       	/* name of material */
13
				/// Name of material
-
 
14
				std::string name;
-
 
15
				
-
 
16
				/// Diffuse reflection
14
				float diffuse[4];			/* diffuse component */
17
				float diffuse[4];			
-
 
18
				
-
 
19
				/// Ambient reflection
15
				float ambient[4];			/* ambient component */
20
				float ambient[4];
-
 
21
				
-
 
22
				/// Specular reflection
16
				float specular[4];		/* specular component */
23
				float specular[4];		
-
 
24
				
-
 
25
				/// Specular exponent
17
				float shininess;			/* specular exponent */
26
				float shininess;			
18
 
27
 
-
 
28
			bool has_texture;
19
				string tex_path, tex_name;
29
				std::string tex_path, tex_name;
20
				int tex_id;
30
				int tex_id;
21
 
31
 
22
				Material():	name("default"), tex_id(-1) 
32
			Material():	name("default"),
-
 
33
					 tex_path(""), tex_name(""), tex_id(-1) 
23
						{
34
						{
24
								shininess = 0;
35
								shininess = 0;
25
								diffuse[0] = 0.8;
36
								diffuse[0] = 0.8;
26
								diffuse[1] = 0.8;
37
								diffuse[1] = 0.8;
27
								diffuse[2] = 0.8;
38
								diffuse[2] = 0.8;
28
								diffuse[3] = 1.0;
39
								diffuse[3] = 1.0;
29
								ambient[0] = 0.2;
40
								ambient[0] = 0.2;
30
								ambient[1] = 0.2;
41
								ambient[1] = 0.2;
31
								ambient[2] = 0.2;
42
								ambient[2] = 0.2;
32
								ambient[3] = 1.0;
43
								ambient[3] = 1.0;
33
								specular[0] = 0.0;
44
								specular[0] = 0.0;
34
								specular[1] = 0.0;
45
								specular[1] = 0.0;
35
								specular[2] = 0.0;
46
								specular[2] = 0.0;
36
								specular[3] = 1.0;
47
								specular[3] = 1.0;
37
						}
48
						}
38
		};
49
		};
39
}
50
}
40
 
51
 
41
#endif
52
#endif
42
 
53