Skeletal Animation Multithread Face
All Classes Namespaces Files Functions Variables Typedefs Pages
hand.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "igl/opengl/glfw/Viewer.h"
6#include "igl/readMESH.h"
7#include "igl/readTGF.h"
8#include "igl/png/readPNG.h"
9#include "igl/directed_edge_parents.h"
10#include "igl/boundary_conditions.h"
11#include "igl/bbw.h"
12#include "igl/lbs_matrix.h"
13#include "igl/normalize_row_sums.h"
14#include "igl/forward_kinematics.h"
15#include "igl/jet.h"
16#include "igl/deform_skeleton.h"
17
18#include "exoskeleton.h"
19#include "animated_hand.h"
20
21typedef std::vector<Eigen::Quaterniond,
22 Eigen::aligned_allocator<Eigen::Quaterniond>> RotationList;
23
25
33class Hand
34{
35public:
37 Hand(Exoskeleton* exo_handler, AnimatedHand* anim_hand,
38 const std::string& mesh_name, const std::string& graph_name,
39 const std::string& texture_name, bool type, const Eigen::Vector3d& origin);
40
44 struct PngImage
45 {
46 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> red;
47 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> green;
48 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> blue;
49 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> a;
50 };
51
53 void update(const std::vector<AnimatedHand::EulerID>& euler_id);
54
56
59 Eigen::MatrixXd get_vertices(void) {return m_vol_mesh_vert; }
60
61 // Returns the surface indices of the hand.
65 Eigen::MatrixXi get_surface_indices(void) { return m_surf_indices; }
66
67private:
68
71
74
76 Eigen::MatrixXi m_bone_edges_indices;
77
79 Eigen::VectorXi m_point_handles;
80
82 Eigen::MatrixXd m_vertex_pos;
83
85 Eigen::VectorXi m_boundary_indices;
86
88 Eigen::MatrixXd m_boundary_conditions;
89
91 igl::BBWData m_bbw_data;
92
94 Eigen::MatrixXd m_weights;
95
97 Eigen::MatrixXd m_g_weights;
98
99private:
100
103
106
108 std::vector<int> m_hand_idx_iter;
109
112
114 int m_pose_size = 20;
115
118
121
123 Eigen::Vector3d m_origin;
124};
Class Exoskeleton.
Definition: exoskeleton.h:20
Class Hand.
Definition: hand.h:34
Eigen::MatrixXd m_vertex_pos
List of vertex positions (C)
Definition: hand.h:82
Eigen::MatrixXi m_tetr_indices
Volume mesh tetrahedral indices(T) and surface element indices(F)
Definition: hand.h:73
PngImage m_texture
Texture image.
Definition: hand.h:117
Eigen::MatrixXi get_surface_indices(void)
Definition: hand.h:65
igl::BBWData m_bbw_data
BBW weights matrix (bbw_data)
Definition: hand.h:91
Eigen::MatrixXd m_weights
List of weights (W)
Definition: hand.h:94
void update(const std::vector< AnimatedHand::EulerID > &euler_id)
Updates the hand.
Definition: hand.cpp:87
Eigen::VectorXi m_boundary_indices
List of boundary indices (b)
Definition: hand.h:85
Eigen::MatrixXd m_vol_mesh_vert_init
Definition: hand.h:70
Eigen::Vector3d m_origin
Hand origin.
Definition: hand.h:123
Eigen::MatrixXi m_bone_edges_indices
Bone-edges skeleton indices (BE)
Definition: hand.h:76
Eigen::MatrixXd get_vertices(void)
Returns the vertices of the hand.
Definition: hand.h:59
Eigen::MatrixXi m_surf_indices
Definition: hand.h:73
RotationList m_anim_pose
Animation pose.
Definition: hand.h:111
Hand(Exoskeleton *exo_handler, AnimatedHand *anim_hand, const std::string &mesh_name, const std::string &graph_name, const std::string &texture_name, bool type, const Eigen::Vector3d &origin)
Constructor.
Definition: hand.cpp:15
Eigen::VectorXi m_point_handles
Point handles list (P)
Definition: hand.h:79
std::vector< int > m_hand_idx_iter
Hand index iterator.
Definition: hand.h:108
Eigen::MatrixXd m_vol_mesh_vert
Volume mesh Vertices (V)
Definition: hand.h:70
Eigen::MatrixXd m_g_weights
Global weights (M)
Definition: hand.h:97
int m_pose_size
Pose size.
Definition: hand.h:114
Exoskeleton * m_exo_handler
Exoskeleton handler pointer.
Definition: hand.h:102
AnimatedHand * m_anim_hand
Animated hand pointer.
Definition: hand.h:105
Eigen::MatrixXd m_boundary_conditions
List of boundary conditions of each weight function (bc)
Definition: hand.h:88
bool m_hand_type
Hand type.
Definition: hand.h:120
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > RotationList
Definition: hand.h:22
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > red
Definition: hand.h:46
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > blue
Definition: hand.h:48
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > a
Definition: hand.h:49
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > green
Definition: hand.h:47