matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Loading...
Searching...
No Matches
Mesh.hpp
Go to the documentation of this file.
1
6#ifndef MATF_RG_PROJECT_MESH_HPP
7#define MATF_RG_PROJECT_MESH_HPP
8
9#include <glm/glm.hpp>
10#include <vector>
12
13namespace engine::resources {
18 struct Vertex {
19 glm::vec3 Position;
20 glm::vec3 Normal;
21 glm::vec2 TexCoords;
22
23 glm::vec3 Tangent;
24 glm::vec3 Bitangent;
25 };
26
31 class Mesh {
33 public:
34
39 void draw(const Shader *shader);
40
44 void destroy();
45
46 private:
53 Mesh(const std::vector<Vertex> &vertices, const std::vector<uint32_t> &indices,
54 std::vector<Texture *> textures);
55
56 uint32_t m_vao{0};
57 uint32_t m_num_indices{0};
58 std::vector<Texture *> m_textures;
59 };
60} // namespace engine
61
62#endif//MATF_RG_PROJECT_MESH_HPP
Defines the Texture class that serves as an abstraction over OpenGL textures.
Processes the meshes in an Assimp scene.
Definition ResourcesController.cpp:72
Represents a mesh in the model in the OpenGL context.
Definition Mesh.hpp:31
uint32_t m_vao
Definition Mesh.hpp:56
uint32_t m_num_indices
Definition Mesh.hpp:57
void draw(const Shader *shader)
Draws the mesh using a given shader. Called by the Model::draw function to draw all the meshes in the...
Definition Mesh.cpp:47
void destroy()
Destroys the mesh in the OpenGL context.
Definition Mesh.cpp:66
std::vector< Texture * > m_textures
Definition Mesh.hpp:58
Represents a linked shader program object within the OpenGL context.
Definition Shader.hpp:32
Definition GraphicsController.hpp:14
Represents a vertex in the mesh.
Definition Mesh.hpp:18
glm::vec3 Position
Definition Mesh.hpp:19
glm::vec3 Bitangent
Definition Mesh.hpp:24
glm::vec3 Tangent
Definition Mesh.hpp:23
glm::vec3 Normal
Definition Mesh.hpp:20
glm::vec2 TexCoords
Definition Mesh.hpp:21