-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModel.h
More file actions
35 lines (29 loc) · 983 Bytes
/
Model.h
File metadata and controls
35 lines (29 loc) · 983 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
#ifndef MODEL_H
#define MODEL_H
#include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLShaderProgram>
#include <vector>
#include <string>
#include "Importer.hpp"
#include "scene.h"
#include "postprocess.h"
#include "Mesh.h"
class Model
{
public:
std::vector<Texture> texturesLoaded;
std::vector<Mesh> meshes;
std::string directory;
Model();
Model(std::string path);
void draw(QOpenGLShaderProgram* program);
void clear();
private:
std::unique_ptr<QOpenGLFunctions_3_3_Core> openGL = std::make_unique<QOpenGLFunctions_3_3_Core>();
void loadModel(std::string path);
void processNode(aiNode* node, const aiScene* scene);
Mesh processMesh(aiMesh* mesh, const aiScene* scene);
std::vector<Texture> loadMaterialTextures(aiMaterial* mat, aiTextureType type, std::string typeName);
unsigned int textureFromFile(std::string path, std::string directory);
};
#endif // MODEL_H