From 97702f11ea016ca2e395f71f03c3fc3a2ee929ca Mon Sep 17 00:00:00 2001 From: esquizo Date: Sun, 17 May 2026 12:02:56 -0300 Subject: adicionado libphysics --- include/physics.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/physics.h (limited to 'include/physics.h') 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); -- cgit v1.2.3