-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.h
More file actions
35 lines (28 loc) · 924 Bytes
/
model.h
File metadata and controls
35 lines (28 loc) · 924 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
#pragma once
#include <stb_image.h>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include "mesh.h"
#include <iostream>
class Model
{
public:
// model data
std::vector<Mesh> meshes;
Model(const char *path, bool gamma = false): gammaCorrection(gamma)
{
loadModel(path);
}
void Draw(Shader &shader);
void DrawMesh(Shader &shader, unsigned int index);
private:
std::string directory;
std::vector<Texture> textures_loaded;
bool gammaCorrection;
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);
};