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
|
#pragma once
#include "graphics/shape.h"
#include "Eigen/StdList"
#include "Eigen/StdVector"
class Shader;
class ARAP
{
private:
Shape m_shape;
public:
ARAP();
void init(Eigen::Vector3f &min, Eigen::Vector3f &max);
void move(int vertex, Eigen::Vector3f pos);
// ================== Students, If You Choose To Modify The Code Below, It's On You
int getClosestVertex(Eigen::Vector3f start, Eigen::Vector3f ray, float threshold)
{
return m_shape.getClosestVertex(start, ray, threshold);
}
void draw(Shader *shader, GLenum mode)
{
m_shape.draw(shader, mode);
}
SelectMode select(Shader *shader, int vertex)
{
return m_shape.select(shader, vertex);
}
bool selectWithSpecifiedMode(Shader *shader, int vertex, SelectMode mode)
{
return m_shape.selectWithSpecifiedMode(shader, vertex, mode);
}
bool getAnchorPos(int lastSelected, Eigen::Vector3f& pos, Eigen::Vector3f ray, Eigen::Vector3f start)
{
return m_shape.getAnchorPos(lastSelected, pos, ray, start);
}
};
|