-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJoint.h
66 lines (51 loc) · 1.06 KB
/
Joint.h
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
57
58
59
60
61
62
63
64
65
66
#ifndef _JOINT_H_
#define _JOINT_H_
#include "GameObject.h"
#include <vector>
#include <memory>
/*
* Joint has channels decribing its degree of freedom and an offset from its parent
* PS. Root is also a joint
*/
class Joint;
/*
enum JOINT_DOF_ENUM
{
DOF_NONE,
DOF_RX,
DOF_RY,
DOF_RZ,
DOF_RX_RY,
DOF_RY_RZ,
DOF_RX_RZ,
DOF_RX_RY_RZ,
DOF_6DOF
};
*/
struct JointLimit
{
float min = 0, max = 0;
};
class Joint : public GameObject
{
public:
Joint(std::string name);
~Joint();
void Initialize();
void Initialize(Transform& trans);
void AddChild(std::shared_ptr<Joint> child);
void setParent(std::shared_ptr<Joint> parent);
inline std::shared_ptr<Joint> getParent() { return m_parent; };
inline std::vector<std::shared_ptr<Joint>>& getChilds() { return m_childs; };
//Joint config
glm::vec3 m_offset_from_parent;
JointLimit m_joint_limit[6];
std::vector<std::string> m_channel_order;
uint16_t m_num_channels;
//uint16_t id;
private:
//JOINT_DOF_ENUM dof_type;
std::shared_ptr<Joint> m_parent;
std::vector<std::shared_ptr<Joint>> m_childs;
};
#endif