goat3d

view src/material.h @ 9:04bb114fcf05

implementing Scene::save, lots to do still
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 23 Aug 2013 06:36:47 +0300
parents cd71f0b92f44
children f1b4c27382ce
line source
1 #ifndef MATERIAL_H_
2 #define MATERIAL_H_
4 #include <string>
5 #include <map>
6 #include <vmath/vmath.h>
8 struct MaterialAttrib {
9 Vector4 value;
10 std::string map;
11 };
13 #define MAT_ATTR_DIFFUSE "diffuse"
14 #define MAT_ATTR_SPECULAR "specular"
15 #define MAT_ATTR_SHININESS "shininess"
16 #define MAT_ATTR_NORMAL "normal"
17 #define MAT_ATTR_BUMP "bump"
18 #define MAT_ATTR_REFLECTION "reflection"
19 #define MAT_ATTR_TRANSMISSION "transmission"
20 #define MAT_ATTR_IOR "ior"
22 class Material {
23 private:
24 static MaterialAttrib def_attr;
26 std::map<std::string, MaterialAttrib> attrib;
28 public:
29 std::string name;
31 int get_attrib_count() const;
32 const char *get_attrib_name(int idx) const;
34 MaterialAttrib &operator [](int idx);
35 const MaterialAttrib &operator [](int idx) const;
37 MaterialAttrib &operator [](const std::string &name);
38 const MaterialAttrib &operator [](const std::string &name) const;
39 };
41 #endif // MATERIAL_H_