-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpbody.h
More file actions
52 lines (50 loc) · 928 Bytes
/
pbody.h
File metadata and controls
52 lines (50 loc) · 928 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
#ifndef PBD_H
#define PBD_H
#include "renderer.h"
#include "simulator.h"
#include "helper.h"
#include "vec2d.h"
class pbody
{
friend class simulator;
friend class renderer;
friend class ui;
private:
int _x, _y;
int _k;
HBRUSH pbrush, bbbrush;
HBRUSH hlbrush, stbrush;
HPEN ppen, bbpen;
HPEN cpen;
HBRUSH cbrush;
vec2 l_countour[3];
vec2 g_countour[3];
RECT bbox;
double angle;
double ang_vel;
double mass;
double I;
vec2 centre_g;
vec2 centre_l;
renderer *re;
bool ishighlited;
unsigned long long lastupdated;
double inangl;
void process();
void draw();
void gcourecalc();
vec2 vel;
collision colis;
bool coll;
int col_edge;
bool isstatic;
public:
pbody(vec2 cnt[3], COLORREF pclr, int cnt_wdth, simulator *sim);
void addimpulse(vec2 origin, vec2 normal, float impulse);
void check_coll(pbody * body);
vec2 vel_temp;
vec2 pos_temp;
float angvel_temp;
float calcI();
};
#endif // PBD_H