Skeletal Animation Multithread Face
include
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
9
class
AnimatedHand
10
{
11
12
public
:
13
AnimatedHand
() {};
14
15
struct
EulerID
16
{
17
// Euler angles
18
std::vector<double>
euler_angles
{0.0, 0.0, 0.0};
19
20
// Frame ID
21
int
frame_id
;
22
};
23
24
struct
HandMap
25
{
26
// Frame's unique index
27
int
frame_idx
;
28
29
// Frames name/id
30
int
frame_id
;
31
32
//Rotation type sequence of rotations (roll=0, pitch=1, yaw=2)
33
int
rot_type
;
34
35
// Rotation direction (1: positive, -1:negative)
36
double
rot_dir
;
37
};
38
39
public
:
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
48
private
:
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
66
int
m_hand_frames_num
= 9;
67
68
// Hand index iterator
69
std::vector<int>
m_hand_idx_iter
= {0, 19, 11, 7, 16, 18, 5, 17, 8};
70
71
};
AnimatedHand
Definition:
animated_hand.h:10
AnimatedHand::m_hand_map
std::vector< HandMap > m_hand_map
Definition:
animated_hand.h:50
AnimatedHand::get_hand_idx_iterator
std::vector< int > get_hand_idx_iterator(void)
Definition:
animated_hand.h:46
AnimatedHand::m_hand_idx_iter
std::vector< int > m_hand_idx_iter
Definition:
animated_hand.h:69
AnimatedHand::AnimatedHand
AnimatedHand()
Definition:
animated_hand.h:13
AnimatedHand::m_hand_frames_num
int m_hand_frames_num
Definition:
animated_hand.h:66
AnimatedHand::get_hand_angles
std::vector< EulerID > get_hand_angles(const std::vector< double > &joint_angles)
Definition:
animated_hand.cpp:4
euler_rotations.h
AnimatedHand::EulerID
Definition:
animated_hand.h:16
AnimatedHand::EulerID::frame_id
int frame_id
Definition:
animated_hand.h:21
AnimatedHand::EulerID::euler_angles
std::vector< double > euler_angles
Definition:
animated_hand.h:18
AnimatedHand::HandMap
Definition:
animated_hand.h:25
AnimatedHand::HandMap::frame_idx
int frame_idx
Definition:
animated_hand.h:27
AnimatedHand::HandMap::rot_type
int rot_type
Definition:
animated_hand.h:33
AnimatedHand::HandMap::frame_id
int frame_id
Definition:
animated_hand.h:30
AnimatedHand::HandMap::rot_dir
double rot_dir
Definition:
animated_hand.h:36
Generated by
1.9.4