-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmesh.h
54 lines (46 loc) · 853 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
#ifdef _MSC_VER
# pragma once
#endif
#ifndef MESH_H
#define MESH_H
#include <vector>
struct mesh_vertex
{
glm::vec3 pos;
glm::vec3 color;
};
struct MeshData
{
public:
static MeshData Load(std::string path);
const std::string& path() const
{
return m_path;
}
const std::vector<mesh_vertex>& vertices() const
{
return m_vertices;
}
std::vector<mesh_vertex>& vertices()
{
return m_vertices;
}
const std::vector<uint16_t>& indices() const
{
return m_indices;
}
std::vector<uint16_t>& indices()
{
return m_indices;
}
private:
MeshData(std::string path, std::vector<mesh_vertex> vertices, std::vector<uint16_t> indices) :
m_path(std::move(path)),
m_vertices(std::move(vertices)),
m_indices(std::move(indices))
{}
std::string m_path;
std::vector<mesh_vertex> m_vertices;
std::vector<uint16_t> m_indices;
};
#endif