-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmesh.h
43 lines (31 loc) · 784 Bytes
/
mesh.h
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 MESH_H
#define MESH_H
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <iostream>
#include <vector>
#include <string>
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
class Mesh : protected QOpenGLFunctions
{
public:
Mesh(std::string mesh_path);
virtual ~Mesh();
void drawMesh(QOpenGLShaderProgram *program);
void loadMesh();
private:
void initMesh();
QVector4D color;
std::string m_mesh_path;
std::vector<QVector3D> m_vertices;
std::vector<QVector2D> m_texcoord;
std::vector<unsigned int> m_faces;
std::vector<QVector3D> m_normals;
QOpenGLBuffer arrayBuf;
QOpenGLBuffer indexBuf;
QOpenGLBuffer normalBuf;
};
#endif // MESH_H