Skeletal Animation Multithread Face
animated_hand.cpp
Go to the documentation of this file.
1#include "../include/animated_hand.h"
2
3// Generate hand angles
4std::vector<AnimatedHand::EulerID> AnimatedHand::get_hand_angles(const
5 std::vector<double>& joint_angles)
6{
7 // Initialize eulerid
8 std::vector<AnimatedHand::EulerID> eul_id(m_hand_frames_num);
9
10 for (size_t i = 0; i < joint_angles.size(); i++)
11 {
12 // Get config i
13 auto config_i = m_hand_map.at(i);
14
15 // Set frame id
16 eul_id.at(config_i.frame_idx).frame_id = config_i.frame_id;
17
18 // Set euler angles
19 eul_id.at(config_i.frame_idx).euler_angles.at(config_i.rot_type) =
20 config_i.rot_dir * joint_angles.at(i);
21 }
22
23 return eul_id;
24}
std::vector< HandMap > m_hand_map
Definition: animated_hand.h:50
int m_hand_frames_num
Definition: animated_hand.h:66
std::vector< EulerID > get_hand_angles(const std::vector< double > &joint_angles)