#ifndef _MATERIAL_H #define _MATERIAL_H #include "common.h" #include "vector.h" #include "light.h" #include "texture.h" #include "shader.h" // material class (far from done). class RenderMaterial: public Optics // uses common optics class { protected: bool dontoverridevertexcolor; float alpha; float shininess; Texture *tex; ShaderProgram *shader; public: RenderMaterial(Texture *tex=NULL,Vector3 ka=Vector3(0.0f),Vector3 kd=Vector3(0.0f), Vector3 ks=Vector3(0.0f),float alpha=1.0f,float shininess=8.0f,bool usevertexcolor=false, ShaderProgram *shader=NULL): tex(tex), Optics(ka,kd,ks), shininess(shininess), dontoverridevertexcolor(usevertexcolor), alpha(alpha), shader(shader) {} virtual ~RenderMaterial() {} // get/set material alpha (applied to diffuse component) virtual void Alpha(float a); virtual float Alpha(); // get/set material shininess virtual void Shininess(float shininess); virtual float Shininess(); // get/set shader program object virtual void Shader(ShaderProgram *shader); virtual ShaderProgram *Shader(); // get/set if it uses vertex colors or material colors virtual void UsingVertexColor(bool usevertexcolor); virtual bool UsingVertexColor(); // get/set texture. this will support multitexturing in the future. virtual void Tex(Texture *tex); virtual Texture *Tex(); }; #endif