-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmesh.h
42 lines (37 loc) · 963 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
#ifndef MESH_H
#define MESH_H
#include <QVector>
#include <QVector3D>
#include <QVector2D>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLTexture>
#include <QOpenGLVertexArrayObject>
#define MAX_BONE_INFLUENCE 4
struct Vertex {
QVector3D Position;
QVector3D Normal;
QVector2D TexCoords;
QVector3D Tangent;
// bitangent
QVector3D Bitangent;
//bone indexes which will influence this vertex
int m_BoneIDs[MAX_BONE_INFLUENCE];
//weights from each bone
float m_Weights[MAX_BONE_INFLUENCE];
};
struct Texture {
QOpenGLTexture *id;
QString type;
QString path; // we store the path of the texture to compare with other textures
};
class Mesh {
public:
QVector<Vertex> vertices;
QVector<unsigned int> indices;
QVector<Texture> textures;
QOpenGLVertexArrayObject *VAO;
QOpenGLBuffer VBO, EBO;
Mesh(const QVector<Vertex> vertices, const QVector<unsigned int> indices, const QVector<Texture> textures);
};
#endif // MESH_H