From 41f84bb52cb002cfe9c6b4dfc94a80ad0a4e4314 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 16 Jul 2023 21:32:33 +0200 Subject: [PATCH] reversed direction of aabb-aabb collision solver terms --- src/corelib/physics.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/physics.c b/src/corelib/physics.c index 8940cf9..1c146f1 100644 --- a/src/corelib/physics.c +++ b/src/corelib/physics.c @@ -156,10 +156,10 @@ float _solve_aabb_aabb(const object_t* a, const object_t* b, float* out_px, floa float bminy = b->physics.aabb.y + b->sprite.y; float bmaxy = bminy + b->physics.aabb.h; - float right = amaxx - bminx; - float left = aminx - bmaxx; - float top = aminy - bmaxy; - float bottom = amaxy - bminy; + float right = bmaxx - aminx; + float left = bminx - amaxx; + float top = bminy - amaxy; + float bottom = bmaxy - aminy; float ret = right; *out_px = right;