src/raytracer.h
branchpyrit
changeset 10 f9fad94cd0cc
parent 7 bf17f9f84c91
child 11 4d192e13ee84
--- a/src/raytracer.h	Thu Nov 22 21:46:09 2007 +0100
+++ b/src/raytracer.h	Fri Nov 23 01:24:33 2007 +0100
@@ -27,7 +27,7 @@
 
 class Raytracer
 {
-	ShapeList shapes;
+	Container *top;
 	vector<Light*> lights;
 	Colour bg_colour;
 	int ao_samples;
@@ -37,11 +37,11 @@
 	inline Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray,
 		float &nearest_distance);
 public:
-	Raytracer(): shapes(), lights(), bg_colour(0.0, 0.0, 0.0), ao_samples(0) {};
+	Raytracer(): lights(), bg_colour(0.0, 0.0, 0.0), ao_samples(0) { top = new KdTree(); };
 	~Raytracer() {};
 	float *render(int w, int h);
 	Colour raytrace(Ray &ray, int depth, Shape *origin_shape);
-	void addshape(Shape *shape);
+	void addshape(Shape *shape) { top->addShape(shape); };
 	void addlight(Light *light);
 
 	void ambientocclusion(int samples, float distance, float angle);