-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mesh.h
62 lines (48 loc) · 924 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
55
56
57
58
59
60
61
#pragma once
// Custom Classes Includes
#include "Shader.h"
// Std. Includes
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
using namespace std;
// GL Includes
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
// Assimp Includes
#include <assimp/Importer.hpp>
struct Vertex {
// Position
glm::vec3 Position;
// Normal
glm::vec3 Normal;
// TexCoords
glm::vec2 TexCoords;
};
struct Material {
glm::vec3 Ka;
glm::vec3 Kd;
glm::vec3 Ks;
};
struct Texture {
GLuint id;
string type;
aiString path;
};
class Mesh
{
private:
GLuint VAO, VBO, EBO;
void setupMesh();
public:
vector<Vertex> vertices;
vector<GLuint> indices;
vector<Texture> textures;
Material material;
Mesh(vector<Vertex> vertices, vector<GLuint> indices, vector<Texture> textures, Material material);
~Mesh();
void Draw(Shader shader);
};