-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScene.h
75 lines (57 loc) · 1.32 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <string>
#include <unordered_map>
#include <set>
#include <memory>
#include "AiScene.h"
#include "Mesh.h"
#include "VertexBuffer.h"
#include "IndexBuffer.h"
#include "Light.cpp"
#include "Camera.h"
#include "ShaderProgram.h"
using Geometry = std::shared_ptr<VertexBuffer>;
class Scene
{
public:
Scene ();
void
setActive (std::string name);
Mesh*
getMesh (std::string name);
Mesh*
getActive ();
std::string
getActiveName ();
void
insertMesh (Mesh* mesh);
void
removeMesh (std::string name);
void
createMesh (std::string name, std::string geomFile, std::string tex,
Material material, ShaderProgram& shader, int index=0);
void
addMesh (Mesh newMesh);
void
createLight (std::string name, std::string type, Vector3 diffuse, Vector3 specular, Vector3 position,
Vector3 attenuationCoefficient, Vector3 direction, float cutoffCosAngle,
float falloff);
void
createLight(std::string name, Light* Light);
void
addLight (const Light& light);
const Light&
getLight () const;
void
setLights (ShaderProgram& shader);
void
draw (Camera cam);
int
size ();
private:
std::set<std::string> m_names;
std::string m_active;
std::unordered_map<std::string, Mesh*> m_meshes;
std::unordered_map<std::string, Light*> m_lights;
Light m_light;
int m_size;
};