-
Notifications
You must be signed in to change notification settings - Fork 1
/
raytracer.h
48 lines (36 loc) · 1.13 KB
/
raytracer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _RAY_TRACER_
#define _RAY_TRACER_
#include <cassert>
#include <vector>
#include "ray.h"
#include "hit.h"
class Mesh;
class ArgParser;
class Radiosity;
class PhotonMapping;
// ====================================================================
// ====================================================================
class RayTracer {
public:
// CONSTRUCTOR & DESTRUCTOR
RayTracer(Mesh *m, ArgParser *a) {
mesh = m;
args = a;
}
// set access to the other modules for hybrid rendering options
void setRadiosity(Radiosity *r) { radiosity = r; }
void setPhotonMapping(PhotonMapping *pm) { photon_mapping = pm; }
// casts a single ray through the scene geometry and finds the closest hit
bool CastRay(Ray &ray, Hit &h, bool use_sphere_patches) const;
// does the recursive work
Vec3f TraceRay(Ray &ray, Hit &hit, int bounce_count = 0) const;
private:
// REPRESENTATION
Mesh *mesh;
ArgParser *args;
Radiosity *radiosity;
PhotonMapping *photon_mapping;
};
// ====================================================================
// ====================================================================
#endif