summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-12 17:58:42 +0100
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-12 17:58:42 +0100
commitb4191bf8f64f984f469dc4fcef0c0f23cf6cf226 (patch)
tree617c5bdba9649f80d65f8ac5762ed178eec30bd9 /tests
parent26b1fd0d842fa3c2f090ead47e8ea7cd2d6515e1 (diff)
downloadredot-engine-b4191bf8f64f984f469dc4fcef0c0f23cf6cf226.tar.gz
[Core] Fix `AABB.encloses` failing on shared upper bound
This differs from `Rect2(i)` and was fixed for those classes in the past
Diffstat (limited to 'tests')
-rw-r--r--tests/core/math/test_aabb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/math/test_aabb.h b/tests/core/math/test_aabb.h
index d3560ff6b6..b9f84cca24 100644
--- a/tests/core/math/test_aabb.h
+++ b/tests/core/math/test_aabb.h
@@ -228,11 +228,20 @@ TEST_CASE("[AABB] Merging") {
TEST_CASE("[AABB] Encloses") {
const AABB aabb_big = AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 5, 6));
+ CHECK_MESSAGE(
+ aabb_big.encloses(aabb_big),
+ "encloses() with itself should return the expected result.");
+
AABB aabb_small = AABB(Vector3(-1.5, 2, -2.5), Vector3(1, 1, 1));
CHECK_MESSAGE(
aabb_big.encloses(aabb_small),
"encloses() with fully contained AABB (touching the edge) should return the expected result.");
+ aabb_small = AABB(Vector3(1.5, 6, 2.5), Vector3(1, 1, 1));
+ CHECK_MESSAGE(
+ aabb_big.encloses(aabb_small),
+ "encloses() with fully contained AABB (touching the edge) should return the expected result.");
+
aabb_small = AABB(Vector3(0.5, 1.5, -2), Vector3(1, 1, 1));
CHECK_MESSAGE(
!aabb_big.encloses(aabb_small),