diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-11-06 01:07:22 -0500 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-11-06 01:12:36 -0500 |
commit | b8b8a7127e3040582c5937fd2dff4c99e94a3b57 (patch) | |
tree | 849c2d29b6fb90100f31de20340d5f0ef4238edf /tests/scene | |
parent | d14f2a31558686f00c4f351ea659918576711a7a (diff) | |
parent | 87318a2fb7fffeb72adca934e31915be077c3d1f (diff) | |
download | redot-engine-b8b8a7127e3040582c5937fd2dff4c99e94a3b57.tar.gz |
Merge commit godotengine/godot@87318a2fb7fffeb72adca934e31915be077c3d1f
Diffstat (limited to 'tests/scene')
-rw-r--r-- | tests/scene/test_primitives.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/scene/test_primitives.h b/tests/scene/test_primitives.h index cab37388fc..ad1a8e8440 100644 --- a/tests/scene/test_primitives.h +++ b/tests/scene/test_primitives.h @@ -106,8 +106,9 @@ TEST_CASE("[SceneTree][Primitive][Capsule] Capsule Primitive") { float dist_to_yaxis = 0.f; for (Vector3 point : points) { float new_dist_to_y = point.x * point.x + point.z * point.z; - if (new_dist_to_y > dist_to_yaxis) + if (new_dist_to_y > dist_to_yaxis) { dist_to_yaxis = new_dist_to_y; + } } CHECK(dist_to_yaxis <= radius * radius); @@ -116,10 +117,12 @@ TEST_CASE("[SceneTree][Primitive][Capsule] Capsule Primitive") { float max_y{ 0.f }; float min_y{ 0.f }; for (Vector3 point : points) { - if (point.y > max_y) + if (point.y > max_y) { max_y = point.y; - if (point.y < min_y) + } + if (point.y < min_y) { min_y = point.y; + } } CHECK(max_y - min_y <= height); @@ -198,12 +201,14 @@ TEST_CASE("[SceneTree][Primitive][Box] Box Primitive") { for (const Vector3 &normal : normals) { bool add_normal{ true }; for (const Vector3 &vec : distinct_normals) { - if (vec.is_equal_approx(normal)) + if (vec.is_equal_approx(normal)) { add_normal = false; + } } - if (add_normal) + if (add_normal) { distinct_normals.push_back(normal); + } } CHECK_MESSAGE(distinct_normals.size() == 6, @@ -220,8 +225,9 @@ TEST_CASE("[SceneTree][Primitive][Box] Box Primitive") { break; } } - if (!normal_correct_direction) + if (!normal_correct_direction) { break; + } } CHECK_MESSAGE(normal_correct_direction, |