summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/physics.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/physics.h b/include/physics.h
new file mode 100644
index 0000000..8a43915
--- /dev/null
+++ b/include/physics.h
@@ -0,0 +1,25 @@
+typedef enum {
+ BTYPE_AABB,
+ BTYPE_TILEMAP,
+} BodyType;
+
+typedef struct Body Body;
+typedef struct CollisionEvent {
+ Body *body1;
+ Body *body2;
+} CollisionEvent;
+
+Body *phxnew(BodyType type);
+void phxdel(Body *);
+
+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 phxgetpos(Body *, float pos[2]);
+void phxgetsize(Body *, float size[2]);
+
+int phxnextcollevent(CollisionEvent *ev);
+void phxtick(float delta);