SuperimposeMesh
All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Mesh.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2019 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This software may be modified and distributed under the terms of the
5  * BSD 3-Clause license. See the accompanying LICENSE file for details.
6  */
7 
8 #ifndef MESH_H
9 #define MESH_H
10 
11 #include <SuperimposeMesh/Shader.h>
12 
13 #include <vector>
14 
15 #include <assimp/scene.h>
16 
17 #include <GL/glew.h>
18 
19 #include <glm/vec2.hpp>
20 #include <glm/vec3.hpp>
21 
22 
23 class Mesh {
24 public:
25  struct Vertex
26  {
27  glm::vec3 Position;
28  glm::vec3 Normal;
29  glm::vec2 TexCoords;
30  };
31 
32  struct Texture
33  {
34  GLuint id;
35  std::string type;
36  aiString path;
37  };
38 
39  Mesh(std::vector<Vertex> vertices, std::vector<GLuint> indices, std::vector<Texture> textures);
40 
41  void Draw(Shader shader);
42 
43 private:
44  GLuint VAO_;
45 
46  GLuint VBO_;
47 
48  GLuint EBO_;
49 
50  std::vector<Vertex> vertices_;
51 
52  std::vector<GLuint> indices_;
53 
54  std::vector<Texture> textures_;
55 };
56 
57 #endif /* MESH_H */
GLuint id
Definition: Mesh.h:34
GLuint VBO_
Definition: Mesh.h:46
Mesh(std::vector< Vertex > vertices, std::vector< GLuint > indices, std::vector< Texture > textures)
Definition: Mesh.cpp:18
Definition: Shader.h:17
void Draw(Shader shader)
Definition: Mesh.cpp:55
Definition: Mesh.h:23
GLuint VAO_
Definition: Mesh.h:44
glm::vec3 Position
Definition: Mesh.h:27
glm::vec3 Normal
Definition: Mesh.h:28
std::vector< GLuint > indices_
Definition: Mesh.h:52
GLuint EBO_
Definition: Mesh.h:48
std::string type
Definition: Mesh.h:35
aiString path
Definition: Mesh.h:36
glm::vec2 TexCoords
Definition: Mesh.h:29
std::vector< Vertex > vertices_
Definition: Mesh.h:50
std::vector< Texture > textures_
Definition: Mesh.h:54