-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMeshData.hpp
More file actions
55 lines (45 loc) · 1.02 KB
/
Copy pathMeshData.hpp
File metadata and controls
55 lines (45 loc) · 1.02 KB
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
55
#pragma once
#include <vector>
#include "Util.hpp"
BEGIN_XE_NAMESPACE
class VertexData
{
public:
VertexData(
unsigned short location,
unsigned short valuesPerVert,
std::vector<float> data) :
_location(location), _valuesPerVert(valuesPerVert), _data(data)
{ }
std::vector<float> data() const { return _data; }
unsigned short location() const { return _location; }
unsigned short valuesPerVert() const { return _valuesPerVert; }
private:
unsigned short _location;
unsigned short _valuesPerVert;
std::vector<float> _data;
};
class MeshData
{
public:
MeshData(
std::vector<VertexData> vertexData,
std::vector<unsigned> indices);
const std::vector<float> &interleavedVertexData() const
{
return _interleavedVertexData;
}
const std::vector<VertexData> &vertexData() const
{
return _vertexData;
}
const std::vector<unsigned> &indices() const
{
return _indices;
}
private:
std::vector<float> _interleavedVertexData;
std::vector<VertexData> _vertexData;
std::vector<unsigned> _indices;
};
END_XE_NAMESPACE