This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathRigPose.hpp
56 lines (46 loc) · 1.59 KB
/
RigPose.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef RigPose_hpp
#define RigPose_hpp
#include <stdio.h>
#include <stdlib.h>
#include <memory>
#include <string>
#include <map>
#include "Rig.hpp"
// Supplimentary joints are keypoints of importance not included in the final rig.
struct SupplimentaryJoint : public Joint
{
SupplimentaryJoint() = default;
SupplimentaryJoint( std::string name,
std::string parentName,
const Joint & joint )
: Joint( joint ), name{ name }, parentName{ parentName } {}
SupplimentaryJoint( const SupplimentaryJoint & ) = default;
std::string name;
std::string parentName;
};
// Wrapper for a rig, has extra information not contained in the rig
class RigPose
{
public:
RigPose() = default;
RigPose( int timestamp, const Rig & rig );
RigPose( const RigPose & ) = default;
RigPose( RigPose && ) = default;
RigPose & operator=( const RigPose & ) = default;
std::string KpType() const { return _kpType; }
void KpType( std::string v ) { _kpType = v; }
int Timestamp() const { return _timestamp; }
void Timestamp( int value ) { _timestamp = value; }
Rig & GetRig() { return _rig; }
const Rig & GetRig() const { return _rig; }
// @ratio is a value in the range [0,1], where @ratio == 0 is same as this, @ratio == 1 is same as rhs
RigPose Interpolate( const RigPose & rhs, double ratio ) const;
// Supplimentary joints are keypoints of importance not included in the final rig.
std::map< std::string, SupplimentaryJoint > SupplimentaryJoints;
protected:
void UpdateAbsRotations();
int _timestamp = -1;
std::string _kpType;
Rig _rig;
};
#endif