-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene.h
53 lines (37 loc) · 777 Bytes
/
scene.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
49
50
51
52
53
/*
* @file: scene.h
* @author: Ondrej Hirjak, 2009
* @description:
*/
#ifndef scene_h
#define scene_h
#include <list>
using namespace std;
class Light
{
public:
Point3D p;
Color c;
Light(Point3D p1, Color c1) : p(p1), c(c1) { }
};
class Scene
{
struct StatData
{
int recDepth;
int lightCount;
};
private:
list<Light *> lights;
list<GeometryObject *> objects;
GeometryObject* GetIntersectObject(Ray &ray, IntersectData *intersectData);
Color InnerTraceRay(Ray &ray, int &rayRecursionDepth, int recursionDepth = 0);
public:
Scene() { }
~Scene() { ClearScene(); }
void ClearScene();
void AddLight(Light *light);
void AddObject(GeometryObject *object);
Color TraceRay(Ray &ray, int &rayRecursionDepth);
};
#endif // scene_h