Subversion Repositories gelsvn

Rev

Rev 178 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __MATERIAL_H__
#define __MATERIAL_H__

#include <string>
#include <vector>
#include "CGLA/Vec3f.h"
#include "CGLA/Vec3i.h"

namespace Geometry
{
                struct Material
                {
                                /// Name of material
                                std::string name;
                                
                                /// Diffuse reflection
                                float diffuse[4];                       
                                
                                /// Ambient reflection
                                float ambient[4];
                                
                                /// Specular reflection
                                float specular[4];              
                                
                                /// Specular exponent
                                float shininess;                        

                        bool has_texture;
                                std::string tex_path, tex_name;
                                int tex_id;

                        Material():     name("default"),
                                         tex_path(""), tex_name(""), tex_id(-1) 
                                                {
                                                                shininess = 0;
                                                                diffuse[0] = 0.8f;
                                                                diffuse[1] = 0.8f;
                                                                diffuse[2] = 0.8f;
                                                                diffuse[3] = 1.0f;
                                                                ambient[0] = 0.2f;
                                                                ambient[1] = 0.2f;
                                                                ambient[2] = 0.2f;
                                                                ambient[3] = 1.0f;
                                                                specular[0] = 0.0f;
                                                                specular[1] = 0.0f;
                                                                specular[2] = 0.0f;
                                                                specular[3] = 1.0f;
                                                }
                };
}

#endif