diff options
author | github-classroom[bot] <66690702+github-classroom[bot]@users.noreply.github.com> | 2024-03-19 02:01:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 02:01:17 +0000 |
commit | 0f8d0e3cfdbd9b11b2357ed3e1a11375e7af8e80 (patch) | |
tree | 48b88b3b3b3a522a90c38b2178363a163a32f2ee /src/arap.h |
Initial commit
Diffstat (limited to 'src/arap.h')
-rw-r--r-- | src/arap.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/arap.h b/src/arap.h new file mode 100644 index 0000000..afa7d63 --- /dev/null +++ b/src/arap.h @@ -0,0 +1,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); + } +}; |