X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmaterial.h;h=4ca5c7d3236dc7faae8697863fdbac7f51650e9d;hp=f5c26aefab503cf219c54740ba5ea967e50cfa4b;hb=9480e20f4de41693ebd1f22e63d3bcecde878f70;hpb=b7c92831285013b2a0783bccaf3d900545ebb5ba diff --git a/src/material.h b/src/material.h index f5c26ae..4ca5c7d 100644 --- a/src/material.h +++ b/src/material.h @@ -1,16 +1,57 @@ #ifndef MATERIAL_H_ #define MATERIAL_H_ +#include +#include #include +#include "texture.h" + +enum { + MTL_TEX_DIFFUSE, + MTL_TEX_SPECULAR, + MTL_TEX_NORMALMAP, + MTL_TEX_LIGHTMAP, + MTL_TEX_REFLECT, + + MTL_TEX_UNKNOWN +}; + +enum { + MTL_MIRROR_NONE, + MTL_MIRROR_AUTO, // determine mirror plane automatically + MTL_MIRROR_AABB_PX, // plane = AABB +X side + MTL_MIRROR_AABB_NX, // plane = AABB -X side + MTL_MIRROR_AABB_PY, // plane = AABB +Y side + MTL_MIRROR_AABB_NY, // plane = AABB -Y side + MTL_MIRROR_AABB_PZ, // plane = AABB +Z side + MTL_MIRROR_AABB_NZ // plane = AABB -Z side +}; + +#define NUM_MTL_TEXTURES MTL_TEX_UNKNOWN class Material { public: + std::string name; Vec3 diffuse, specular; float shininess; float alpha; + float reflect; + int flat_mirror; // see MTL_MIRROR_* enumerations above + + Texture *stdtex[NUM_MTL_TEXTURES]; + std::vector textures; + 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_