/
scene.h
executable file
·58 lines (39 loc) · 1.23 KB
/
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
54
55
56
57
#ifndef SCENE_H_
#define SCENE_H_
#include <iostream>
#include <fstream>
#include <memory>
#include <vector>
#include <glm/glm.hpp>
#include <random>
#include <assimp/Importer.hpp> // C++ importer interface
#include <assimp/scene.h> // Output data structure
#include <assimp/postprocess.h> // Post processing flags
#include "primitive.h"
#include "sphere.h"
#include "triangle.h"
#include "diffuse.h"
#include "light_source.h"
#include "generic_material.h"
#include "mirror.h"
#include "smooth_dieletric.h"
#include "rough_conductor.h"
#include "bvh.h"
#include "object.h"
class Scene
{
public:
enum AcelerationMethod{ NONE, BVH};
Scene( void );
~Scene( void );
bool intersect( const Ray &ray,
IntersectionRecord &intersection_record ) const;
void load(const AcelerationMethod* method, const BVH::SplitMethod* splitMethod);
bool load( std::vector<Object*> &objects, const AcelerationMethod* method, const BVH::SplitMethod* splitMethod);
AcelerationMethod method_ = BVH;
private:
void setMethod(const BVH::SplitMethod* splitMethod);
class BVH* bvh;
std::vector< Primitive::PrimitiveUniquePtr > primitives_;
};
#endif /* SCENE_H_ */