-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmesh.h
executable file
·54 lines (43 loc) · 864 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
44
45
46
47
48
49
50
51
52
53
54
#ifndef MESH_H
#define MESH_H
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
#include <glm/glm.hpp>
#include <GLES3/gl3.h>
using namespace std;
struct Vertex {
// position
glm::vec3 Position;
// normal
// glm::vec3 Normal;
// texCoords
glm::vec2 TexCoords;
// tangent
// glm::vec3 Tangent;
// // bitangent
// glm::vec3 Bitangent;
};
struct Texture {
unsigned int id;
string type;
string path;
};
class Mesh
{
public:
/* Mesh Data */
vector<Vertex> vertices;
vector<unsigned int> indices;
vector<Texture> textures;
unsigned int vao;
Mesh(vector<Vertex> vertices, vector<unsigned int> indices,
vector<Texture> textures);
void Draw(GLuint shaderID);
private:
GLuint vbo, ibo;
void setupMesh();
};
#endif // MESH_H