From 60c320fb1083d2181967a2343e2384d1d60ac253 Mon Sep 17 00:00:00 2001 From: Sara Date: Mon, 6 Jan 2025 10:55:30 +0100 Subject: [PATCH] fix: bounding box calculation in aabb-aabb collision --- src/core/collision_shape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/collision_shape.cpp b/src/core/collision_shape.cpp index 2ae502f..ff2a3bc 100644 --- a/src/core/collision_shape.cpp +++ b/src/core/collision_shape.cpp @@ -95,7 +95,7 @@ bool CollisionShape::overlap_aabb_aabb(ShapeAABB lhs, Transform lhst, ShapeAABB std::abs((lhst.position.y - lhs.v_extent) - (rhst.position.y + rhs.v_extent)), lhs.v_extent, rhs.v_extent })}; - return bound_x < (lhs.h_extent + rhs.h_extent) || bound_y < (lhs.v_extent + rhs.v_extent); + return bound_x < (lhs.h_extent + rhs.h_extent) && bound_y < (lhs.v_extent + rhs.v_extent); } CollidableNode *CollisionShape::get_owner() const {