include/scene.h
branchpyrit
changeset 31 b4e09433934a
parent 28 ffe83ca074f3
child 34 28f6e8b9d5d1
--- a/include/scene.h	Sat Dec 08 16:02:37 2007 +0100
+++ b/include/scene.h	Sun Dec 09 10:45:26 2007 +0100
@@ -128,19 +128,26 @@
 {
 public:
 	Float ambient, diffuse, specular, shininess; // Phong constants
-	Float reflection; // how much reflectife is the surface
-	Float refraction; // refraction index
-	Float transmitivity;
+	Float reflectivity; // how much reflective is the surface
+	Float transmissivity, refract_index; // part of light which can be refracted; index of refraction
 	Texture texture;
 
 	Material(const Colour &acolour) {
 		texture.colour = acolour;
-		ambient = 0.1;
-		diffuse = 0.5;
-		specular = 0.1;
+		ambient = 0.2;
+		diffuse = 0.8;
+		specular = 0.2;
 		shininess = 0.5;
-		reflection = 0.5;
+		reflectivity = 0.2;
+		transmissivity = 0.0;
+		refract_index = 1.3;
 	}
+
+	void setPhong(const Float amb, const Float dif, const Float spec, const Float shin)
+		{ ambient = amb; diffuse = dif; specular = spec; shininess = shin; };
+	void setReflectivity(const Float refl) { reflectivity = refl; };
+	void setTransmissivity(const Float trans, const Float rindex)
+		{ transmissivity = trans; refract_index = rindex; };
 };
 
 class Shape