-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene.h
47 lines (35 loc) · 878 Bytes
/
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
#pragma once
#include <string>
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/rotate_vector.hpp>
#include <model.h>
#include <shader.h>
#include <object.h>
class Scene{
private:
//remembers OpenGL state machine state to avoid double-loading.
GLint loadedShaderID;
GLint loadedBufferArrayID;
public:
//Camera data
glm::mat4x4 viewMatrix;
glm::mat4x4 projMatrix;
glm::mat4x4 viewProjMatrix;
glm::vec3 cameraPos;
float cameraAngleAround;
float cameraAngleUpdown;
glm::vec3 cameraNormal;
//Object data
std::vector<Object*> objects;
//---
Scene();
~Scene();
//Camera functions
void updateCamera();
void setAspectRatio(float ratio);
//Object functions
void addObject(Object* object);
void draw();
};