36 float ao_distance, ao_angle; |
37 float ao_distance, ao_angle; |
37 int num_threads; |
38 int num_threads; |
38 |
39 |
39 Vector3 SphereDistribute(int i, int n, float extent, Vector3 &normal); |
40 Vector3 SphereDistribute(int i, int n, float extent, Vector3 &normal); |
40 public: |
41 public: |
41 Raytracer(): camera(NULL), lights(), bg_colour(0.0, 0.0, 0.0), |
42 Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0.0, 0.0, 0.0), |
42 ao_samples(0), num_threads(4) { top = new KdTree(); }; |
43 ao_samples(0), num_threads(4) {}; |
43 ~Raytracer() { delete top; }; |
44 void render(int w, int h, float *buffer); |
44 float *render(int w, int h); |
|
45 Colour raytrace(Ray &ray, int depth, Shape *origin_shape); |
45 Colour raytrace(Ray &ray, int depth, Shape *origin_shape); |
46 void addshape(Shape *shape) { top->addShape(shape); }; |
46 void addshape(Shape *shape) { top->addShape(shape); }; |
47 void addlight(Light *light); |
47 void addlight(Light *light); |
48 void setCamera(Camera *cam) { camera = cam; }; |
48 void setCamera(Camera *cam) { camera = cam; }; |
|
49 void setTop(Container *atop) { top = atop; }; |
|
50 Container *getTop() { return top; }; |
49 |
51 |
50 void ambientocclusion(int samples, float distance, float angle); |
52 void ambientocclusion(int samples, float distance, float angle); |
51 void setThreads(int num) { num_threads = num; }; |
53 void setThreads(int num) { num_threads = num; }; |
52 }; |
54 }; |
53 |
55 |