-
Notifications
You must be signed in to change notification settings - Fork 1
/
scene.h
42 lines (30 loc) · 869 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
#ifndef SCENE_H
#define SCENE_H
#include <QMap>
#include <QHash>
#include <QOpenGLFunctions>
#include "mesh.h"
#include "glmesh.h"
#include "shader.h"
#include "camera.h"
class Scene: public QOpenGLFunctions
{
public:
Scene();
void render(Shader &shader);
void addMesh(Mesh &mesh, const QString& meshName = 0);
void buildMesh(QVector<Vertex> &v, QVector<unsigned int> &i);
void deleteMesh(const QString& meshName);
void clear();
// set mesh named "meshName" as active if it's stored in the scene
void setActiveMesh(QString &meshName);
// returns a reference to the currently active mesh (to interact)
Mesh& activeMesh();
Mesh& mesh(QString meshName);
// returns a list with all stored meshes
const QList<QString> meshList();
Camera camera;
private:
QMap<QString,Mesh> meshes;
};
#endif // SCENE_H