blob: da858c3d2791226524a11f7f43513618d3725c29 (
plain)
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
|
#define BLOCK_SIZE 16
typedef struct Body {
BodyType type;
int active;
vec2 pos;
vec2 size;
vec2 vel;
vec2 accel;
} Body;
typedef struct BlockmapNode BlockmapNode;
struct BlockmapNode {
BodyID id;
BlockmapNode *next;
};
typedef struct TestCollision TestCollision;
struct TestCollision {
BodyID a, b;
};
void phxmapcollision(Body *);
void phxbodycollision(Body *, Body *);
int phxaabbcheck(Body *a, Body *b);
void phxcollisionmap(Body *a);
void phxaabbresolv(Body *a, Body *b, vec2 p, vec2 n);
int phxenqevent(CollisionEvent *ev);
int phxdeqevent(CollisionEvent *ev);
void phxmakeblkmap(void);
BlockmapNode *phxnodelist(float x, float y);
void __phxnarrowphase(int n, TestCollision coll[n]);
extern int phxmapwidth, phxmapheight;
extern int *phxmapbuffer;
extern Body phxbodypool[];
extern int phxbodypoolsize;
|