Skeletal Animation Multithread Face
animated_hand.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <vector>
5#include <map>
6#include "euler_rotations.h"
7
8
10{
11
12public:
14
15 struct EulerID
16 {
17 // Euler angles
18 std::vector<double> euler_angles{0.0, 0.0, 0.0};
19
20 // Frame ID
22 };
23
24 struct HandMap
25 {
26 // Frame's unique index
28
29 // Frames name/id
31
32 //Rotation type sequence of rotations (roll=0, pitch=1, yaw=2)
34
35 // Rotation direction (1: positive, -1:negative)
36 double rot_dir;
37 };
38
39public:
40
41 // Generate hand angles
42 std::vector<EulerID>
43 get_hand_angles(const std::vector<double>& joint_angles);
44
45 // Get hand index iterator
46 std::vector<int> get_hand_idx_iterator(void) { return m_hand_idx_iter; }
47
48private:
49
50 std::vector<HandMap> m_hand_map{
51 HandMap{0, 0, 2, -1},
52 HandMap{0, 0, 0, 1},
53 HandMap{1, 19, 0, 1},
54 HandMap{2, 11, 0, 1},
55 HandMap{3, 7, 2, -1},
56 HandMap{3, 7, 0, 1},
57 HandMap{4, 16, 0, 1},
58 HandMap{5, 18, 0, 1},
59 HandMap{6, 5, 1, 1},
60 HandMap{6, 5, 0, 1},
61 HandMap{6, 5, 2, -1},
62 HandMap{7, 17, 2, -1},
63 HandMap{8, 8, 2, -1}};
64
65 // Number of hand frames
67
68 // Hand index iterator
69 std::vector<int> m_hand_idx_iter = {0, 19, 11, 7, 16, 18, 5, 17, 8};
70
71};
std::vector< HandMap > m_hand_map
Definition: animated_hand.h:50
std::vector< int > get_hand_idx_iterator(void)
Definition: animated_hand.h:46
std::vector< int > m_hand_idx_iter
Definition: animated_hand.h:69
int m_hand_frames_num
Definition: animated_hand.h:66
std::vector< EulerID > get_hand_angles(const std::vector< double > &joint_angles)
std::vector< double > euler_angles
Definition: animated_hand.h:18