-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModel.h
More file actions
38 lines (30 loc) · 969 Bytes
/
Copy pathModel.h
File metadata and controls
38 lines (30 loc) · 969 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
35
36
37
38
#ifndef MODEL_H
#define MODEL_H
#include <QOpenGLFunctions_3_3_Core>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <QVector>
#include <QString>
#include "Mesh.h"
class Model
{
public:
Model(QString const &path, bool gamma = false);
~Model();
void Draw(QOpenGLShaderProgram* shaderProgram);
bool initFromScene(const aiScene* pscene,const QString &path);
Mesh initMesh(const aiScene* pscene,const aiMesh* pmesh);
void updateModel(QString const &path);
QVector<Texture> textures_loaded;
QVector<Mesh> meshes;
QString directory;
bool gammaCorrection;
private:
void loadModel(QString const& path);
void processNode(aiNode* node, const aiScene* scene);
Mesh processMesh(aiMesh* mesh,const aiScene* scene);
QVector<Texture> loadMaterialTextures(aiMaterial* mat,aiTextureType type,QString typeName);
QOpenGLFunctions_3_3_Core *core;
};
#endif // MODEL_H