forked from PrototypeX29A/norbit
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgame_object.h
More file actions
50 lines (36 loc) · 908 Bytes
/
game_object.h
File metadata and controls
50 lines (36 loc) · 908 Bytes
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
#include <string>
#include "physics.h"
using namespace std;
#if !defined(GO_H)
#define GO_H
class shape
{
public:
shape ();
virtual ~ shape ();
virtual void draw () = 0;
};
class game_object
{
public:
game_object();
void set_rigid_body (rigid_body *);
void set_position (float x, float y, float z);
static void set_simulation_world (simulation_world * w);
void apply_force (vector_2 const &F, vector_2 const &Pl); // TODO: Make it fit for 3D
void apply_force_G (vector_2 const &F, vector_2 const &Pl); // TODO: Make it fit for 3D
float posx ();
float posy ();
float posz ();
float orientation (); // TODO: Make it fit for 3D
float mass ();
int get_id()const {return id;}
void set_id(int id_){ id = id_;}
rigid_body* physics() {return body; } ;
private:
int id;
shape * object_shape;
static simulation_world *world;
rigid_body *body;
};
#endif