-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMesh.h
More file actions
53 lines (44 loc) · 1.01 KB
/
Copy pathMesh.h
File metadata and controls
53 lines (44 loc) · 1.01 KB
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
44
45
46
47
48
49
50
51
52
53
#ifndef MESH_H
#define MESH_H
#include <QOpenGLFunctions_3_3_Core>
#include <QVector>
#include <QVector3D>
#include <QString>
#include <QOpenGLTexture>
//#include "Texture2D.h"
#include <QOpenGLShaderProgram>
struct Vertex {
// position
QVector3D Position;
// normal
QVector3D Normal;
// texCoords
QVector3D TexCoords;
// tangent
//QVector3D Tangent;
// bitangent
//QVector3D Bitangent;
};
struct Texture {
//unsigned int id;
QString type;
QString fileName;
QSharedPointer<QOpenGLTexture> texture;
};
class Mesh
{
public:
Mesh(QVector<Vertex> vertices,QVector<unsigned int> indices,QVector<Texture> textures);
~Mesh();
QVector<Vertex> vertices;
QVector<unsigned int> indices;
QVector<Texture> textures;
unsigned int VAO;
unsigned int VBO, EBO;
QOpenGLFunctions_3_3_Core* core;
bool isInitialized;
void draw(QOpenGLShaderProgram* shaderProgram);
private:
void setupMesh(QOpenGLShaderProgram* shaderProgram);
};
#endif // MESH_H