-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScene.h
64 lines (44 loc) · 1.16 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
#ifndef _SCENE_INCLUDE
#define _SCENE_INCLUDE
#include <iostream>
#include <unordered_map>
#include <glm/glm.hpp>
#include "Camera.h"
#include "ShaderProgram.h"
#include "TriangleMesh.h"
#include "Text.h"
#include "GraphicsObject.hpp"
// Scene contains all the entities of our game.
// It is responsible for updating and render them.
class Scene {
public:
Scene();
~Scene();
void init();
bool loadMesh(const char *filename);
void update(int deltaTime);
void render();
void renderPolygonMesh(TriangleMesh * mesh, glm::vec4 color = glm::vec4(0.9f, 0.9f, 0.95f, 1.0f));
void renderRayCastingLine(glm::vec3 start, glm::vec3 end);
Camera &getCamera();
void switchPolygonMode();
void DisplayFps(size_t fps);
private:
void initShaders();
private:
Camera camera;
GraphicsObject * floor_;
GraphicsObject * object_;
GraphicsObject * object_lod_1;
GraphicsObject * object_lod_2;
GraphicsObject * object_lod_3;
GraphicsObject * object_lod_4;
GraphicsObject * object_lod_5;
ShaderProgram basicProgram;
float currentTime;
int frame_time_;
bool bPolygonFill;
Text text;
size_t fps_;
};
#endif // _SCENE_INCLUDE