summaryrefslogtreecommitdiff
path: root/libphysics/dat.h
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-05-17 12:02:56 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-05-17 12:02:56 -0300
commit97702f11ea016ca2e395f71f03c3fc3a2ee929ca (patch)
tree20380f895ee422c48b970c7da5b921e046e35da4 /libphysics/dat.h
parent5c6b3c19172948cf2e1800a9333cfcd858ee829c (diff)
adicionado libphysics
Diffstat (limited to 'libphysics/dat.h')
-rw-r--r--libphysics/dat.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libphysics/dat.h b/libphysics/dat.h
new file mode 100644
index 0000000..75869a4
--- /dev/null
+++ b/libphysics/dat.h
@@ -0,0 +1,24 @@
+typedef struct Body {
+ BodyType type;
+ int active;
+ vec2 pos;
+ vec2 size;
+ vec2 vel;
+ vec2 accel;
+} Body;
+
+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);
+
+extern int phxmapwidth, phxmapheight;
+extern int *phxmapbuffer;
+
+extern Body phxbodypool[];
+extern int phxbodypoolsize;