]> git.jsancho.org Git - gacela.git/blob - gacela_chipmunk.c
(no commit message)
[gacela.git] / gacela_chipmunk.c
1 #include <chipmunk/chipmunk.h>
2
3 void
4 gacela_cpInitChipmunk (void)
5 {
6   cpInitChipmunk ();
7 }
8
9 void
10 gacela_cpResetShapeIdCounter (void)
11 {
12   cpResetShapeIdCounter ();
13 }
14
15 int
16 gacela_cpSpaceNew (void)
17 {
18   return cpSpaceNew ();
19 }
20
21 void
22 gacela_cpSpaceAddBody (int space, int body)
23 {
24   cpSpaceAddBody (space, body);
25 }
26
27 void
28 gacela_cpSpaceAddShape (int space, int shape)
29 {
30   cpSpaceAddShape (space, shape);
31 }
32
33 void
34 gacela_cpSpaceFree (int space)
35 {
36   cpSpaceFree (space);
37 }
38
39 int
40 gacela_cpBodyNew (float mass, float inertia, float infinity)
41 {
42   return cpBodyNew ((mass >= infinity ? INFINITY : mass), (inertia >= infinity ? INFINITY : inertia));
43 }
44
45 float
46 gacela_cpMomentForCircle (float mass, float r1, float r2, float x, float y)
47 {
48   return cpMomentForCircle (mass, r1, r2, cpv (x, y));
49 }
50
51 void
52 gacela_cpBodyFree (int space)
53 {
54   cpBodyFree (space);
55 }
56
57 int
58 gacela_cpCircleShapeNew (int body, float radius, float x, float y)
59 {
60   return cpCircleShapeNew (body, radius, cpv (x, y));
61 }
62
63 int
64 gacela_cpPolyShapeNew (int body, int numVerts, int verts, float x, float y)
65 {
66   return cpPolyShapeNew (body, numVerts, verts, cpv (x, y));
67 }
68
69 void
70 gacela_cpShapeFree (int shape)
71 {
72   cpShapeFree (shape);
73 }
74
75 void
76 set_cp_space_gravity (int space, float x, float y)
77 {
78   cpSpace *s = space;
79
80   s->gravity = cpv (x, y);
81 }