-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel3D.hpp
More file actions
43 lines (29 loc) · 997 Bytes
/
Model3D.hpp
File metadata and controls
43 lines (29 loc) · 997 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
39
40
41
42
43
#ifndef Model3D_hpp
#define Model3D_hpp
#include "Mesh.hpp"
#include "tiny_obj_loader.h"
#include "stb_image.h"
#include <iostream>
#include <string>
#include <vector>
namespace gps {
class Model3D {
public:
~Model3D();
void LoadModel(std::string fileName);
void LoadModel(std::string fileName, std::string basePath);
void Draw(gps::Shader shaderProgram);
private:
// Component meshes - group of objects
std::vector<gps::Mesh> meshes;
// Associated textures
std::vector<gps::Texture> loadedTextures;
// Does the parsing of the .obj file and fills in the data structure
void ReadOBJ(std::string fileName, std::string basePath);
// Retrieves a texture associated with the object - by its name and type
gps::Texture LoadTexture(std::string path, std::string type);
// Reads the pixel data from an image file and loads it into the video memory
GLuint ReadTextureFromFile(const char* file_name);
};
}
#endif /* Model3D_hpp */