mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
[Core] Fix AABB.encloses failing on shared upper bound
This differs from `Rect2(i)` and was fixed for those classes in the past
(cherry picked from commit b4191bf8f6)
This commit is contained in:
committed by
Yuri Sizov
parent
881d253897
commit
ad57a98eb0
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user