forked from delphist2008/phys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.h
More file actions
60 lines (48 loc) · 941 Bytes
/
ui.h
File metadata and controls
60 lines (48 loc) · 941 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
51
52
53
#ifndef UI_H
#define UI_H
#include "renderer.h"
#include "simulator.h"
#include "pbody.h"
#include "helper.h"
#define RMBB 0
#define CREATE 1
#define RMBNB 2
#define SELECT 3
#define MOVE 4
#define STATIC 5
static char statelist[10][255] = {"RMBB\0","CREATE\0", "RMBNB\0", "SELECT\0", "MOVE\0", "STATIC\0"};
class ui
{
friend class pbody;
friend class simulator;
friend class renderer;
private:
void onLMBD();
void onLMBU();
void onRMBD();
void onRMBU();
void onMM();
void onKeyDown(int key);
void onKeyUp(int key);
public:
void init(simulator * s, renderer * r);
simulator * sim;
renderer * rend;
ui();
pbody* body_at_click;
pbody* body_at_cursor;
pbody* newbody;
fpoint pol_to_create[3];
fpoint click_pos;
fpoint mouse_pos;
fpoint impulse_apply_vector;
fpoint impulse_line_begin;
int click_count;
int _X, _Y;
void update();
int state;
char debugstr[255];
int oldstate;
int dx, dy;
};
#endif //UI_H