30 Container *top; |
30 Container *top; |
31 vector<Light*> lights; |
31 vector<Light*> lights; |
32 Colour bg_colour; |
32 Colour bg_colour; |
33 int ao_samples; |
33 int ao_samples; |
34 float ao_distance, ao_angle; |
34 float ao_distance, ao_angle; |
|
35 int num_threads; |
35 |
36 |
36 Vector3 SphereDistribute(int i, int n, float extent, Vector3 &normal); |
37 Vector3 SphereDistribute(int i, int n, float extent, Vector3 &normal); |
37 public: |
38 public: |
38 Raytracer(): lights(), bg_colour(0.0, 0.0, 0.0), ao_samples(0) { top = new KdTree(); }; |
39 Raytracer(): lights(), bg_colour(0.0, 0.0, 0.0), ao_samples(0), num_threads(4) |
39 ~Raytracer() {}; |
40 { top = new KdTree(); }; |
|
41 ~Raytracer() { delete top; }; |
40 float *render(int w, int h); |
42 float *render(int w, int h); |
41 Colour raytrace(Ray &ray, int depth, Shape *origin_shape); |
43 Colour raytrace(Ray &ray, int depth, Shape *origin_shape); |
42 void addshape(Shape *shape) { top->addShape(shape); }; |
44 void addshape(Shape *shape) { top->addShape(shape); }; |
43 void addlight(Light *light); |
45 void addlight(Light *light); |
44 |
46 |
45 void ambientocclusion(int samples, float distance, float angle); |
47 void ambientocclusion(int samples, float distance, float angle); |
|
48 void setThreads(int num) { num_threads = num; }; |
46 }; |
49 }; |
47 |
50 |
48 #endif |
51 #endif |