summaryrefslogtreecommitdiff
path: root/servers/physics_2d
diff options
context:
space:
mode:
authorRafał Mikrut <mikrutrafal@protonmail.com>2022-10-01 21:09:22 +0200
committerRafał Mikrut <mikrutrafal@protonmail.com>2022-10-01 21:09:22 +0200
commit2233624152a3b041daeab8b0fd88a2061b7b8565 (patch)
tree27b6bc31c38e0629a23ea6142f54724045aa2bc5 /servers/physics_2d
parent24115beb3c69e648b1d48f969785b9b0729e1be8 (diff)
Remove usage of unitialized variables
Diffstat (limited to 'servers/physics_2d')
-rw-r--r--servers/physics_2d/godot_body_pair_2d.cpp2
-rw-r--r--servers/physics_2d/godot_collision_solver_2d.cpp2
-rw-r--r--servers/physics_2d/godot_collision_solver_2d_sat.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/servers/physics_2d/godot_body_pair_2d.cpp b/servers/physics_2d/godot_body_pair_2d.cpp
index 2f2af15da7..7b7c67bbc2 100644
--- a/servers/physics_2d/godot_body_pair_2d.cpp
+++ b/servers/physics_2d/godot_body_pair_2d.cpp
@@ -170,7 +170,7 @@ bool GodotBodyPair2D::_test_ccd(real_t p_step, GodotBody2D *p_A, int p_shape_A,
Vector2 mnormal = motion / mlen;
- real_t min, max;
+ real_t min = 0.0, max = 0.0;
p_A->get_shape(p_shape_A)->project_rangev(mnormal, p_xform_A, min, max);
// Did it move enough in this direction to even attempt raycast?
diff --git a/servers/physics_2d/godot_collision_solver_2d.cpp b/servers/physics_2d/godot_collision_solver_2d.cpp
index 761a1c33e2..817e3a3e7b 100644
--- a/servers/physics_2d/godot_collision_solver_2d.cpp
+++ b/servers/physics_2d/godot_collision_solver_2d.cpp
@@ -197,7 +197,7 @@ bool GodotCollisionSolver2D::solve_concave(const GodotShape2D *p_shape_A, const
real_t axis_scale = 1.0 / axis.length();
axis *= axis_scale;
- real_t smin, smax;
+ real_t smin = 0.0, smax = 0.0;
p_shape_A->project_rangev(axis, rel_transform, smin, smax);
smin *= axis_scale;
smax *= axis_scale;
diff --git a/servers/physics_2d/godot_collision_solver_2d_sat.cpp b/servers/physics_2d/godot_collision_solver_2d_sat.cpp
index 77186d3810..259ed833ab 100644
--- a/servers/physics_2d/godot_collision_solver_2d_sat.cpp
+++ b/servers/physics_2d/godot_collision_solver_2d_sat.cpp
@@ -234,7 +234,7 @@ public:
axis = Vector2(0.0, 1.0);
}
- real_t min_A, max_A, min_B, max_B;
+ real_t min_A = 0.0, max_A = 0.0, min_B = 0.0, max_B = 0.0;
if (castA) {
shape_A->project_range_cast(motion_A, axis, *transform_A, min_A, max_A);