-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjvertexsystem.hpp
39 lines (30 loc) · 1.25 KB
/
objvertexsystem.hpp
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
#ifndef OBJVERTEXSYSTEM_HPP
#define OBJVERTEXSYSTEM_HPP
#include "vec.hpp"
#include <QGLWidget>
#include <vector>
class ObjVertexSystem {
public:
ObjVertexSystem();
void updateSystem();
void initObjVertexSystem();
std::vector<GLfloat> *mpObjVertices;
std::vector<Vec3f> *mpVertices;
std::vector<std::vector<int>> *mpTets;
private:
Vec3f getGlobalCoords(int vertIdx);
void updateObjVertices();
float determinant4x4(const Vec4f& v0, const Vec4f& v1,
const Vec4f& v2, const Vec4f& v3);
int findTetNumber(const Vec3f& vert);
Vec4f calcBarycentricCoords(const Vec3f& p,
const std::vector<Vec3f>& tetVertices);
bool checkPointInTet(const Vec3f& p,
const std::vector<Vec3f>& tetVertices);
std::vector<Vec3f> getTetVertices(int tetNumber);
Vec3f calcGlobalCoords(const Vec4f& barycentricCoords,
int tetNumber);
std::vector<int> mTetNumbers;
std::vector<Vec4f> mBarycentricCoords;
};
#endif // OBJVERTEXSYSTEM_HPP