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
engine
include
engine
resources
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>
11
#include <
engine/resources/Texture.hpp
>
12
13
namespace
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
{
32
friend
class
AssimpSceneProcessor
;
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
Texture.hpp
Defines the Texture class that serves as an abstraction over OpenGL textures.
engine::resources::AssimpSceneProcessor
Processes the meshes in an Assimp scene.
Definition
ResourcesController.cpp:72
engine::resources::Mesh
Represents a mesh in the model in the OpenGL context.
Definition
Mesh.hpp:31
engine::resources::Mesh::m_vao
uint32_t m_vao
Definition
Mesh.hpp:56
engine::resources::Mesh::m_num_indices
uint32_t m_num_indices
Definition
Mesh.hpp:57
engine::resources::Mesh::draw
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
engine::resources::Mesh::destroy
void destroy()
Destroys the mesh in the OpenGL context.
Definition
Mesh.cpp:66
engine::resources::Mesh::m_textures
std::vector< Texture * > m_textures
Definition
Mesh.hpp:58
engine::resources::Shader
Represents a linked shader program object within the OpenGL context.
Definition
Shader.hpp:32
engine::resources
Definition
GraphicsController.hpp:14
engine::resources::Vertex
Represents a vertex in the mesh.
Definition
Mesh.hpp:18
engine::resources::Vertex::Position
glm::vec3 Position
Definition
Mesh.hpp:19
engine::resources::Vertex::Bitangent
glm::vec3 Bitangent
Definition
Mesh.hpp:24
engine::resources::Vertex::Tangent
glm::vec3 Tangent
Definition
Mesh.hpp:23
engine::resources::Vertex::Normal
glm::vec3 Normal
Definition
Mesh.hpp:20
engine::resources::Vertex::TexCoords
glm::vec2 TexCoords
Definition
Mesh.hpp:21
Generated by
1.9.8