summaryrefslogtreecommitdiff
path: root/include/physics.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/physics.h')
-rw-r--r--include/physics.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/physics.h b/include/physics.h
index 8a43915..5c4f377 100644
--- a/include/physics.h
+++ b/include/physics.h
@@ -1,3 +1,5 @@
+typedef int BodyID;
+
typedef enum {
BTYPE_AABB,
BTYPE_TILEMAP,
@@ -5,21 +7,21 @@ typedef enum {
typedef struct Body Body;
typedef struct CollisionEvent {
- Body *body1;
- Body *body2;
+ BodyID body1;
+ BodyID body2;
} CollisionEvent;
-Body *phxnew(BodyType type);
-void phxdel(Body *);
+BodyID phxnew(BodyType type);
+void phxdel(BodyID);
void phxsetmap(int w, int h, int *tiles);
-void phxsetpos(Body *, float x, float y);
-void phxsetsize(Body *, float w, float h);
-void phxapplyaccel(Body *, float f[2]);
+void phxsetpos(BodyID, float x, float y);
+void phxsetsize(BodyID, float w, float h);
+void phxapplyaccel(BodyID, float f[2]);
-void phxgetpos(Body *, float pos[2]);
-void phxgetsize(Body *, float size[2]);
+void phxgetpos(BodyID, float pos[2]);
+void phxgetsize(BodyID, float size[2]);
int phxnextcollevent(CollisionEvent *ev);
void phxtick(float delta);