utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
mesh.cpp
1/*
2** ETIB PROJECT, 2026
3** utility
4** File description:
5** mesh
6*/
7
8#include <utility/graphic/mesh.hpp>
9
10namespace utility::graphic
11{
12 Mesh::Mesh(const std::vector<VertexF> &vertices,
13 const std::vector<uint32_t> &indices)
14 : _vertices(vertices)
15 , _indices(indices)
16 {
17 }
18
20 {
21 }
22
23 void Mesh::addVertex(const VertexF &vertex)
24 {
25 _vertices.push_back(vertex);
26 }
27
28 void Mesh::addIndex(uint32_t index)
29 {
30 _indices.push_back(index);
31 }
32
33 const std::vector<VertexF> &Mesh::getVertices() const
34 {
35 return _vertices;
36 }
37
38 const std::vector<uint32_t> &Mesh::getIndices() const
39 {
40 return _indices;
41 }
42
43 void Mesh::reset(void)
44 {
45 _vertices.clear();
46 _indices.clear();
47 }
48} // namespace utility::graphic
void addVertex(const VertexF &vertex)
Add a vertex to the mesh.
Definition mesh.cpp:23
Mesh(const std::vector< VertexF > &vertices, const std::vector< uint32_t > &indices)
Constructs a Mesh object with the specified vertices and indices.
Definition mesh.cpp:12
const std::vector< VertexF > & getVertices() const
Get the vertices of the mesh.
Definition mesh.cpp:33
void reset(void)
Reset the mesh by clearing all vertices and indices.
Definition mesh.cpp:43
const std::vector< uint32_t > & getIndices() const
Get the indices of the mesh.
Definition mesh.cpp:38
void addIndex(uint32_t index)
Add an index to the mesh.
Definition mesh.cpp:28
~Mesh()
Destructs the Mesh object, releasing any allocated resources.
Definition mesh.cpp:19
Vertex type containing common mesh attributes.
Definition vertex.hpp:38