include/scene.h
branchpyrit
changeset 31 b4e09433934a
parent 28 ffe83ca074f3
child 34 28f6e8b9d5d1
equal deleted inserted replaced
30:33f95441790e 31:b4e09433934a
   126 
   126 
   127 class Material
   127 class Material
   128 {
   128 {
   129 public:
   129 public:
   130 	Float ambient, diffuse, specular, shininess; // Phong constants
   130 	Float ambient, diffuse, specular, shininess; // Phong constants
   131 	Float reflection; // how much reflectife is the surface
   131 	Float reflectivity; // how much reflective is the surface
   132 	Float refraction; // refraction index
   132 	Float transmissivity, refract_index; // part of light which can be refracted; index of refraction
   133 	Float transmitivity;
       
   134 	Texture texture;
   133 	Texture texture;
   135 
   134 
   136 	Material(const Colour &acolour) {
   135 	Material(const Colour &acolour) {
   137 		texture.colour = acolour;
   136 		texture.colour = acolour;
   138 		ambient = 0.1;
   137 		ambient = 0.2;
   139 		diffuse = 0.5;
   138 		diffuse = 0.8;
   140 		specular = 0.1;
   139 		specular = 0.2;
   141 		shininess = 0.5;
   140 		shininess = 0.5;
   142 		reflection = 0.5;
   141 		reflectivity = 0.2;
       
   142 		transmissivity = 0.0;
       
   143 		refract_index = 1.3;
   143 	}
   144 	}
       
   145 
       
   146 	void setPhong(const Float amb, const Float dif, const Float spec, const Float shin)
       
   147 		{ ambient = amb; diffuse = dif; specular = spec; shininess = shin; };
       
   148 	void setReflectivity(const Float refl) { reflectivity = refl; };
       
   149 	void setTransmissivity(const Float trans, const Float rindex)
       
   150 		{ transmissivity = trans; refract_index = rindex; };
   144 };
   151 };
   145 
   152 
   146 class Shape
   153 class Shape
   147 {
   154 {
   148 public:
   155 public: