summaryrefslogtreecommitdiff
path: root/libphysics/narrow.c
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-06-03 16:10:57 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-06-03 16:10:57 -0300
commit83b1c06b186614d1bf2171feb46754bd8a8e6dfa (patch)
treeb8da3f436cba5736d481690935135fe5c6b3badc /libphysics/narrow.c
parent005f0a3185eb8085f6e0de11e3cfd0a3d9167719 (diff)
libphysics removido (ideia jogada fora)
Diffstat (limited to 'libphysics/narrow.c')
-rw-r--r--libphysics/narrow.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/libphysics/narrow.c b/libphysics/narrow.c
deleted file mode 100644
index f6fdde6..0000000
--- a/libphysics/narrow.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <vecmath.h>
-#include <physics.h>
-#include <stdlib.h>
-
-#include "dat.h"
-
-void
-__phxnarrowphase(int n, TestCollision tests[n])
-{
- CollisionEvent event;
-
- for(int i = 0; i < n; i++) {
- TestCollision *c = tests + i;
- Body *a = c->a + phxbodypool;
- Body *b = c->b + phxbodypool;
-
- if(a < b && phxaabbcheck(a, b)) {
- float p[2], n[2], rvel[2], j;
- phxaabbresolv(a, b, p, n);
-
- vec2_sub(rvel, a->vel, b->vel);
- j = vec2_dot(rvel, n);
-
- vec2_sub_scaled(a->vel, a->vel, n, 0.5);
- vec2_sub_scaled(b->vel, b->vel, n, -0.5);
-
- vec2_sub_scaled(a->pos, a->pos, p, 0.5);
- vec2_sub_scaled(b->pos, b->pos, p, -0.5);
-
- event.body1 = __getbodyid(a);
- event.body2 = __getbodyid(b);
- phxenqevent(&event);
- }
- }
-}
-