Skeletal Animation Multithread Face
skeletal_animation.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <vector>
5#include <stdlib.h>
6#include <memory>
7#include <boost/filesystem.hpp>
8
9#include "exoskeleton.h"
10#include "animated_hand.h"
11#include "hand.h"
12#include "menu_handler.h"
13#include "face.h"
14
15
16#include <Eigen/Geometry>
17#include <Eigen/StdVector>
18#include "igl/opengl/glfw/Viewer.h"
19#include "igl/readMESH.h"
20#include "igl/readTGF.h"
21#include "igl/png/readPNG.h"
22#include "igl/directed_edge_parents.h"
23#include "igl/boundary_conditions.h"
24#include "igl/bbw.h"
25#include "igl/lbs_matrix.h"
26#include "igl/normalize_row_sums.h"
27#include "igl/forward_kinematics.h"
28#include "igl/jet.h"
29#include "igl/deform_skeleton.h"
30
31typedef std::vector<Eigen::Quaterniond,
32 Eigen::aligned_allocator<Eigen::Quaterniond>> RotationList;
33
35
39{
40
41public:
42
45
47 void initialize(igl::opengl::glfw::Viewer* viewer,
48 Exoskeleton* left_exo, AnimatedHand* anim_hand,
49 MenuHandler* menu_handler);
50
52 bool animation_loop(igl::opengl::glfw::Viewer & viewer);
53
54private:
55
57 std::string m_hand_mesh_name =
58 boost::filesystem::system_complete("share/hand.mesh").string();
59
61 std::string m_hand_graph_name =
62 boost::filesystem::system_complete("share/hand.tgf").string();
63
65 std::string m_hand_texture_name =
66 boost::filesystem::system_complete("share/texture.png").string();
67
68private:
69
72
75
78
80 std::shared_ptr<Hand> m_left_hand, m_right_hand;
81
83 std::shared_ptr<Face> m_face;
84
86 Eigen::Vector3d m_left_origin = Eigen::Vector3d(1.0, 0.0, 0.0);
87
89 Eigen::Vector3d m_right_origin = Eigen::Vector3d(-1.0, 0.0, 0.0);
90
93
95 void setup_meshes(igl::opengl::glfw::Viewer& viewer);
96};
Class Exoskeleton.
Definition: exoskeleton.h:20
Class MenuHandler.
Definition: menu_handler.h:23
Class SkeletalAnimation.
Exoskeleton * m_left_exo
Exoskeleton handler pointer.
std::string m_hand_texture_name
Texture name.
MenuHandler * m_menu_handler
Menu handler pointer.
SkeletalAnimation()
Constructor.
AnimatedHand * m_anim_hand
Animated hand pointer.
bool m_initialize_animation
Start animation flag.
bool animation_loop(igl::opengl::glfw::Viewer &viewer)
Animation loop callback.
void initialize(igl::opengl::glfw::Viewer *viewer, Exoskeleton *left_exo, AnimatedHand *anim_hand, MenuHandler *menu_handler)
Initialize animation.
Eigen::Vector3d m_right_origin
Right hand origin.
Eigen::Vector3d m_left_origin
Left hand origin.
std::shared_ptr< Face > m_face
Face handler.
std::shared_ptr< Hand > m_left_hand
Left and right hand.
std::string m_hand_graph_name
Skeleton graph filename.
std::shared_ptr< Hand > m_right_hand
void setup_meshes(igl::opengl::glfw::Viewer &viewer)
Setup meshes.
std::string m_hand_mesh_name
Mesh filename.
std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > RotationList