diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-09-02 10:40:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-02 10:40:12 +0200 |
commit | 437fb12e1aa3135dc7fa336bd0a53036be649ce8 (patch) | |
tree | df8288d031d4fdf06de7f8f717cb2eafd1c2854f /core/math | |
parent | ded74dedefcb03fee1079d33f9688c2e401ea00e (diff) | |
parent | 9c63ab99f0a505b0f60079bb30cc453b4415fddc (diff) |
Merge pull request #10877 from hpvb/fix-unitialized-variables
Fix use of unitialized variables
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/face3.cpp | 2 | ||||
-rw-r--r-- | core/math/quick_hull.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 748faad28f..e1b172e491 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -296,7 +296,7 @@ void Face3::get_support(const Vector3 &p_normal, const Transform &p_transform, V /** FIND SUPPORT VERTEX **/ int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; for (int i = 0; i < 3; i++) { diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 2f3445bdcd..e0137b6921 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -76,7 +76,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me int simplex[4]; { - real_t max, min; + real_t max = 0, min = 0; for (int i = 0; i < p_points.size(); i++) { @@ -99,7 +99,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me //third vertex is one most further away from the line { - real_t maxd; + real_t maxd = 0; Vector3 rel12 = p_points[simplex[0]] - p_points[simplex[1]]; for (int i = 0; i < p_points.size(); i++) { @@ -121,7 +121,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me //fourth vertex is the one most further away from the plane { - real_t maxd; + real_t maxd = 0; Plane p(p_points[simplex[0]], p_points[simplex[1]], p_points[simplex[2]]); for (int i = 0; i < p_points.size(); i++) { |