blob: 35e4fb4c0cf6c4b53cc9cae79c5d79cb1bc8bbfc (
plain)
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
|
#pragma once
#include "utils/scenedata.h"
#include "utils/sceneparser.h"
#include "camera/camera.h"
#include "accelerate/kdtree.h"
#include "accelerate/bvh.h"
// A class representing a scene to be ray-traced
// Feel free to make your own design choices for RayTraceScene, the functions below are all optional / for your convenience.
// You can either implement and use these getters, or make your own design.
// If you decide to make your own design, feel free to delete these as TAs won't rely on them to grade your assignments.
class RayTraceScene
{
public:
RayTraceScene(int width, int height, const RenderData &metaData, int depth=500);
// The getter of the width of the scene
const int& width() const;
// The getter of the height of the scene
const int& height() const;
// The getter of the global data of the scene
const SceneGlobalData& getGlobalData() const;
const std::vector<RenderShapeData> getShapes() const;
const std::vector<SceneLightData> getLights() const;
// The getter of the shared pointer to the camera instance of the scene
const Camera& getCamera() const;
KdTree *m_kdTree;
bvh *m_bvh;
const int &depth() const;
private:
int m_width;
int m_height;
SceneGlobalData m_sceneGlobalData;
Camera& m_camera;
std::vector<RenderShapeData>m_shapes;
std::vector<SceneLightData>m_lights;
int m_depth;
};
|