Remove usage of unitialized variables

This commit is contained in:
Rafał Mikrut
2022-10-01 21:09:22 +02:00
parent 24115beb3c
commit 2233624152
17 changed files with 32 additions and 32 deletions

View File

@@ -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?

View File

@@ -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;

View File

@@ -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);