1#include "../include/hand.h"
16 const std::string& mesh_name,
const std::string& graph_name,
17 const std::string& texture_name,
bool type,
const Eigen::Vector3d& origin)
43 std::cout <<
"Error: BBW Error" << std::endl;
87void Hand::update(
const std::vector<AnimatedHand::EulerID>& euler_id)
89 for (
size_t i = 0; i < euler_id.size(); i++)
92 std::vector<double> euler_i = euler_id.at(i).euler_angles;
95 int frame_id_i = euler_id.at(i).frame_id;
100 euler_i.at(1), euler_i.at(2));
103 m_anim_pose.at(frame_id_i) = Eigen::Quaterniond(quatern.
w, quatern.
x,
104 quatern.
y, quatern.
z);
109 std::vector<Eigen::Vector3d> v_tran;
124 Eigen::Affine3d a = Eigen::Affine3d::Identity();
130 a.rotate(v_rot.at(i));
132 t_mat.block(i*(vert_dim+1), 0, vert_dim+1, vert_dim) =
133 a.matrix().transpose().block(0, 0, vert_dim+1, vert_dim);
141 Eigen::Matrix3d mirror = Eigen::Matrix3d::Identity();
std::vector< int > get_hand_idx_iterator(void)
static Quaternions euler_to_quaternions(double phi, double theta, double psi)
Convert Euler angles to quaternions.
Eigen::MatrixXd m_vertex_pos
List of vertex positions (C)
Eigen::MatrixXi m_tetr_indices
Volume mesh tetrahedral indices(T) and surface element indices(F)
PngImage m_texture
Texture image.
igl::BBWData m_bbw_data
BBW weights matrix (bbw_data)
Eigen::MatrixXd m_weights
List of weights (W)
void update(const std::vector< AnimatedHand::EulerID > &euler_id)
Updates the hand.
Eigen::VectorXi m_boundary_indices
List of boundary indices (b)
Eigen::MatrixXd m_vol_mesh_vert_init
Eigen::Vector3d m_origin
Hand origin.
Eigen::MatrixXi m_bone_edges_indices
Bone-edges skeleton indices (BE)
Eigen::MatrixXi m_surf_indices
RotationList m_anim_pose
Animation pose.
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.
Eigen::VectorXi m_point_handles
Point handles list (P)
std::vector< int > m_hand_idx_iter
Hand index iterator.
Eigen::MatrixXd m_vol_mesh_vert
Volume mesh Vertices (V)
Eigen::MatrixXd m_g_weights
Global weights (M)
int m_pose_size
Pose size.
Exoskeleton * m_exo_handler
Exoskeleton handler pointer.
AnimatedHand * m_anim_hand
Animated hand pointer.
Eigen::MatrixXd m_boundary_conditions
List of boundary conditions of each weight function (bc)
bool m_hand_type
Hand type.
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > RotationList
Custom quaternions struct: .
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > red
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > blue
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > a
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > green