diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 11:42:47 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 11:42:47 +0200 |
commit | 5b6ccf2fd2c0e01481bad47d4403e7173476bfe2 (patch) | |
tree | 9b12a6a603d21f6e0feee43a7c06f031e0fd284d /servers/physics_2d | |
parent | 33f4c5282f3f6f64cd97c30978d130b6efbc94ce (diff) | |
parent | 2233624152a3b041daeab8b0fd88a2061b7b8565 (diff) |
Merge pull request #66720 from qarmin/unintialized_memory
Remove usage of unitialized variables
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/godot_body_pair_2d.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/godot_collision_solver_2d.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/godot_collision_solver_2d_sat.cpp | 2 |
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 52237539c0..9c7b8fbe53 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 8aa30ad6a4..f8924239ea 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); |