diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-01 22:33:39 +0200 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-02 01:59:26 +0200 |
commit | 9c63ab99f0a505b0f60079bb30cc453b4415fddc (patch) | |
tree | 7014cb6e8c2e71a0583656f76d3d37d719a74fb0 /core/math/quick_hull.cpp | |
parent | dac150108ab3c1f41d5fd86cc6853f883064caaf (diff) |
Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'core/math/quick_hull.cpp')
-rw-r--r-- | core/math/quick_hull.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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++) { |