-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMesh.h
43 lines (35 loc) · 893 Bytes
/
CMesh.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
#ifndef CMESH_H_INCL
#define CMESH_H_INCL
#include <vector>
#include <string>
#include "tiny_obj_loader.h"
#include "CSpline.h"
#include "vbo.h"
#include "opengl.h"
using namespace tinyobj;
typedef unsigned int uint;
typedef std::vector<shape_t> ShapeVector;
typedef std::vector<uint> UintVector;
typedef std::vector<float> FloatVector;
typedef std::vector<vec3> PointVector;
typedef std::vector<vbo_t> VBOVector;
class CMesh
{
public:
CMesh();
CMesh(const CMesh& other);
CMesh(const char* fname);
CMesh(CSpline* spline,
const PointVector& stencil,
int numberOfDivisions,
float texscale = 1.f,
const vec3& stencilscale = vec3(1,1,0));
const ShapeVector& getShapes() const { return Shapes; }
const VBOVector& getVBOs() const { return VBOs; }
private:
void generateVBO();
void pushVector(FloatVector& where, const vec3& v);
ShapeVector Shapes;
VBOVector VBOs;
};
#endif