-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmesh.h
More file actions
46 lines (35 loc) · 1.09 KB
/
mesh.h
File metadata and controls
46 lines (35 loc) · 1.09 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
#ifndef MESH_H
#define MESH_H
#include <QVector>
#include "util.h"
class Mesh
{
public:
Mesh();
void addVertex(float x, float y, float z);
void addUV(float u, float v);
void addTriangle(int i, int j, int k);
int numTriangles();
QString meshName() { return _meshName; }
void setMeshName(QString name) { _meshName = name; }
int textureSize() { return _textureSize; }
void setTextureSize(int size) { _textureSize = size; }
QString texturePath() { return _texturePath; }
void setTexturePath(QString path) { _texturePath = path; }
QString geometryPath() { return _geometryPath; }
void setGeometryPath(QString path) { _geometryPath = path; }
QJsonObject serialize();
// TODO: make these private
QVector<Point3> _vertices;
QVector<Point3> _uvs;
QVector<unsigned int> _triangleIndices;
private:
int _textureSize = 0;
QString _texturePath = "";
QString _geometryPath = "";
QString _meshName = "";
QJsonArray serializeVertices();
QJsonArray serializeUvs();
QJsonArray serializeTriangleIndices();
};
#endif // MESH_H