-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScene.h
More file actions
80 lines (61 loc) · 1.45 KB
/
Scene.h
File metadata and controls
80 lines (61 loc) · 1.45 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// Created by 孙万捷 on 16/4/14.
//
#ifndef SUNPATHTRACER_SCENE_H
#define SUNPATHTRACER_SCENE_H
#include <vector>
#include <cuda_runtime.h>
#include "cuda_material.h"
#include "cuda_camera.h"
#include "cuda_shape.h"
#include "cuda_scene.h"
#include "cuda_environment_light.h"
class Scene
{
public:
Scene();
~Scene();
void AddCamera(const cudaCamera& camera)
{
this->camera = camera;
}
void AddEnvLight(const cudaEnvironmentLight& env_light)
{
this->env_light = env_light;
}
void AddMaterial(const cudaMaterial& material)
{
this->materials.push_back(material);
}
void AddSphere(const cudaSphere& sphere)
{
this->spheres.push_back(sphere);
}
void AddAAB(const cudaAAB& aab)
{
this->aab.push_back(aab);
}
void AddPlane(const cudaPlane& plane)
{
this->planes.push_back(plane);
}
void AddMesh(const cudaMesh& mesh)
{
this->meshes.push_back(mesh);
}
unsigned int GetLastMaterialID(void) {return this->materials.size() - 1;}
void BuildSceneForGPU(cudaScene& scene);
public:
//camera
cudaCamera camera;
//environment light
cudaEnvironmentLight env_light;
//material
std::vector<cudaMaterial> materials;
//geometries
std::vector<cudaSphere> spheres;
std::vector<cudaAAB> aab;
std::vector<cudaPlane> planes;
std::vector<cudaMesh> meshes;
};
#endif //SUNPATHTRACER_SCENE_H