projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ExhibitSlots and exhibit placement (initial)
[laserbrain_demo]
/
src
/
material.h
diff --git
a/src/material.h
b/src/material.h
index
f5c26ae
..
c46a21d
100644
(file)
--- a/
src/material.h
+++ b/
src/material.h
@@
-1,16
+1,43
@@
#ifndef MATERIAL_H_
#define MATERIAL_H_
#ifndef MATERIAL_H_
#define MATERIAL_H_
+#include <vector>
+#include <string>
#include <gmath/gmath.h>
#include <gmath/gmath.h>
+#include "texture.h"
+
+enum {
+ MTL_TEX_DIFFUSE,
+ MTL_TEX_SPECULAR,
+ MTL_TEX_NORMALMAP,
+ MTL_TEX_LIGHTMAP,
+ MTL_TEX_ENVMAP,
+
+ MTL_TEX_UNKNOWN
+};
+
+#define NUM_MTL_TEXTURES MTL_TEX_UNKNOWN
class Material {
public:
class Material {
public:
+ std::string name;
Vec3 diffuse, specular;
float shininess;
float alpha;
Vec3 diffuse, specular;
float shininess;
float alpha;
+ Texture *stdtex[NUM_MTL_TEXTURES];
+ std::vector<Texture*> textures;
+
Material();
void setup() const;
Material();
void setup() const;
+
+ void add_texture(Texture *tex, int type = MTL_TEX_UNKNOWN);
+ void remove_texture(Texture *tex);
};
};
+// returns MTL_TEX_whatever by name
+int mtl_parse_type(const char *str);
+// returns the name of a material type
+const char *mtl_type_string(int type);
+
#endif // MATERIAL_H_
#endif // MATERIAL_H_