-
Notifications
You must be signed in to change notification settings - Fork 0
/
Joint.h
56 lines (42 loc) · 1.11 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
#ifndef JOINT_H
#define JOINT_H
#include "Node.h"
#include <QVector3D>
#include <QPair>
#include <QHash>
#include "DOF.h"
class Box;
class Joint : public Node
{
public:
enum Type {
BallJoint,
TranslationalJoint,
FixedJoint,
PrismaticJoint,
HingeJoint,
FreeJoint,
Undefined
};
Joint(Node* parent);
virtual ~Joint();
virtual void init();
virtual void update(float elapsed);
virtual void resetLocal();
virtual void updateMatrix();
void setBox(QVector3D const& min, QVector3D const& max);
void setMinBox(QVector3D const& min);
void setMaxBox(QVector3D const& max);
QVector3D const& minBox() const;
QVector3D const& maxBox() const;
QVector3D const& offset() const;
void setOffset(QVector3D const& newOffset);
void setOffset(float x, float y, float z);
Type type() const;
protected:
void setType(Type type);
QVector3D _offset;
Box* _box;
Type _type;
};
#endif // JOINT_H