-
Notifications
You must be signed in to change notification settings - Fork 1
/
rigidbody.h
59 lines (42 loc) · 1.17 KB
/
rigidbody.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
#ifndef TAK_RIGIDBODY_H__
#define TAK_RIGIDBODY_H__
#ifdef TAK_USE_BULLET_PHYSICS
#include <btBulletDynamicsCommon.h>
#include "vector3.h"
class SceneNode;
class RigidBody
{
public:
RigidBody(float weight);
virtual ~RigidBody();
void SetPosition(const Vector3f& position);
Vector3f GetPosition() const;
Vector3f GetRotation() const;
void SetLinearVelocity(const Vector3f& velocity);
Vector3f GetLinearVelocity() const;
void SetKinematic();
void ApplyForce(const Vector3f& force);
btRigidBody* GetInternalHandle() const;
void LinkWithNode(SceneNode* node);
SceneNode* GetLinkedNode() const;
protected:
void SetInternalHandle(btRigidBody* handle);
private:
btRigidBody* m_rigidBody;
float m_weight;
SceneNode* m_node;
};
class BoxRigidBody : public RigidBody
{
public:
BoxRigidBody(float weight, const Vector3f& position, const Vector3f& size);
~BoxRigidBody();
};
class CapsuleRigidBody : public RigidBody
{
public:
CapsuleRigidBody(float weight);
~CapsuleRigidBody();
};
#endif
#endif // TAK_RIGIDBODY_H__