goat3d
view src/material.h @ 40:a5c5cec3cb88
- added mesh attribute and face append functions
- added Int4 constructor
- continued the blender exporter
- fixed a bug in clean_filename which made it produce unterminated strings
- renamed clean_filename to goat3d_clean_filename and made it extern
- added call to goat3d_clean_filename in the mesh XML export code to cleanup ctm filenames
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 13 Oct 2013 10:14:19 +0300 |
parents | 04bb114fcf05 |
children | 498ca7ac7047 |
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;
12 MaterialAttrib() : value(1, 1, 1, 1) {}
13 };
15 class Material {
16 private:
17 static MaterialAttrib def_attr;
19 std::map<std::string, MaterialAttrib> attrib;
21 public:
22 std::string name;
24 int get_attrib_count() const;
25 const char *get_attrib_name(int idx) const;
27 MaterialAttrib &operator [](int idx);
28 const MaterialAttrib &operator [](int idx) const;
30 MaterialAttrib &operator [](const std::string &name);
31 const MaterialAttrib &operator [](const std::string &name) const;
32 };
34 #endif // MATERIAL_H_