-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.h
More file actions
34 lines (31 loc) · 910 Bytes
/
model.h
File metadata and controls
34 lines (31 loc) · 910 Bytes
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
#ifndef MODEL_H
#define MODEL_H
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <QString>
#include <QOpenGLShaderProgram>
#include <QOpenGLExtraFunctions>
#include "mesh.h"
class QOpenGLTexture;
class Model: public QObject, public QOpenGLExtraFunctions
{
Q_OBJECT
public:
Model(QOpenGLContext* context, QString path);
~Model();
void draw(QOpenGLShaderProgram* shader);
friend class OpenGLWidget;
private:
QVector<Mesh> meshes;
QString directory;
QVector<Texture> textures_loaded;
QMatrix4x4 modelMatrix;
void loadModel(QString path);
void processNode(aiNode *node, const aiScene *scene);
Mesh processMesh(aiMesh *mesh, const aiScene *scene);
QVector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, QString typeName);
void setupMesh(Mesh& mesh);
void drawMesh(QOpenGLShaderProgram* shader, Mesh& mesh);
};
#endif // MODEL_H