From bb5f390fb9b466be35a5df7651323d7e66afca31 Mon Sep 17 00:00:00 2001
From: Thaddeus Crews <repiteo@outlook.com>
Date: Fri, 21 Jun 2024 11:21:18 -0500
Subject: Style: Apply `clang-tidy` fixes (superficial)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
---
 modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp')

diff --git a/modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp b/modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp
index c53c8481f4..2adbb51297 100644
--- a/modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp
+++ b/modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp
@@ -76,8 +76,9 @@ struct _CollectorCallback {
 	Vector3 *prev_axis = nullptr;
 
 	_FORCE_INLINE_ void call(const Vector3 &p_point_A, const Vector3 &p_point_B, Vector3 p_normal) {
-		if (p_normal.dot(p_point_B - p_point_A) < 0)
+		if (p_normal.dot(p_point_B - p_point_A) < 0) {
 			p_normal = -p_normal;
+		}
 		if (swap) {
 			callback(p_point_B, 0, p_point_A, 0, -p_normal, userdata);
 		} else {
@@ -175,10 +176,11 @@ static void _generate_contacts_edge_edge(const Vector3 *p_points_A, int p_point_
 	// The normal should be perpendicular to both edges.
 	Vector3 normal = rel_A.cross(rel_B);
 	real_t normal_len = normal.length();
-	if (normal_len > 1e-3)
+	if (normal_len > 1e-3) {
 		normal /= normal_len;
-	else
+	} else {
 		normal = p_callback->normal;
+	}
 	p_callback->call(closest_A, closest_B, normal);
 }
 
@@ -784,8 +786,9 @@ static void analytic_sphere_collision(const Vector3 &p_origin_a, real_t p_radius
 
 	// Calculate the sphere overlap, and bail if not overlapping
 	real_t overlap = p_radius_a + p_radius_b - b_to_a_len;
-	if (overlap < 0)
+	if (overlap < 0) {
 		return;
+	}
 
 	// Report collision
 	p_collector->collided = true;
-- 
cgit v1.2.3