diff options
| author | esquizo <esquizo+noreply@esquizo.net> | 2026-05-17 12:02:56 -0300 |
|---|---|---|
| committer | esquizo <esquizo+noreply@esquizo.net> | 2026-05-17 12:02:56 -0300 |
| commit | 97702f11ea016ca2e395f71f03c3fc3a2ee929ca (patch) | |
| tree | 20380f895ee422c48b970c7da5b921e046e35da4 /include | |
| parent | 5c6b3c19172948cf2e1800a9333cfcd858ee829c (diff) | |
adicionado libphysics
Diffstat (limited to 'include')
| -rw-r--r-- | include/physics.h | 25 |
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); |
