mirror mtledit
[laserbrain_demo] / src / material.h
1 #ifndef MATERIAL_H_
2 #define MATERIAL_H_
3
4 #include <vector>
5 #include <string>
6 #include <gmath/gmath.h>
7 #include "texture.h"
8
9 enum {
10         MTL_TEX_DIFFUSE,
11         MTL_TEX_SPECULAR,
12         MTL_TEX_NORMALMAP,
13         MTL_TEX_LIGHTMAP,
14         MTL_TEX_ENVMAP,
15
16         MTL_TEX_UNKNOWN
17 };
18
19 #define NUM_MTL_TEXTURES        MTL_TEX_UNKNOWN
20
21 class Material {
22 public:
23         std::string name;
24         Vec3 diffuse, specular;
25         float shininess;
26         float alpha;
27
28         float reflect;
29         bool flat_mirror;
30
31         Texture *stdtex[NUM_MTL_TEXTURES];
32         std::vector<Texture*> textures;
33
34         Material();
35         void setup() const;
36
37         void add_texture(Texture *tex, int type = MTL_TEX_UNKNOWN);
38         void remove_texture(Texture *tex);
39 };
40
41 // returns MTL_TEX_whatever by name
42 int mtl_parse_type(const char *str);
43 // returns the name of a material type
44 const char *mtl_type_string(int type);
45
46 #endif  // MATERIAL_H_