diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-29 10:16:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-29 10:16:46 +0200 |
commit | 18e88c85631adb0b83114687f8c20d9b210a88bf (patch) | |
tree | 28d1817600fb497215008d08045ed4e20a8cba95 /core/math/delaunay.h | |
parent | 90cc1d3c1d2e77ca72c5949b21a5c40738abcd81 (diff) | |
parent | b659e1eb2b732ebc836614735438ca0bcdc8a32d (diff) |
Merge pull request #18992 from aaronfranke/mono-equal-approx
[Core] [Mono] Improve and use approximate equality methods
Diffstat (limited to 'core/math/delaunay.h')
-rw-r--r-- | core/math/delaunay.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/delaunay.h b/core/math/delaunay.h index bd0cf97937..ed52c506db 100644 --- a/core/math/delaunay.h +++ b/core/math/delaunay.h @@ -80,11 +80,11 @@ public: } static bool edge_compare(const Vector<Vector2> &p_vertices, const Edge &p_a, const Edge &p_b) { - if (p_vertices[p_a.edge[0]].distance_to(p_vertices[p_b.edge[0]]) < CMP_EPSILON && p_vertices[p_a.edge[1]].distance_to(p_vertices[p_b.edge[1]]) < CMP_EPSILON) { + if (Math::is_zero_approx(p_vertices[p_a.edge[0]].distance_to(p_vertices[p_b.edge[0]])) && Math::is_zero_approx(p_vertices[p_a.edge[1]].distance_to(p_vertices[p_b.edge[1]]))) { return true; } - if (p_vertices[p_a.edge[0]].distance_to(p_vertices[p_b.edge[1]]) < CMP_EPSILON && p_vertices[p_a.edge[1]].distance_to(p_vertices[p_b.edge[0]]) < CMP_EPSILON) { + if (Math::is_zero_approx(p_vertices[p_a.edge[0]].distance_to(p_vertices[p_b.edge[1]])) && Math::is_zero_approx(p_vertices[p_a.edge[1]].distance_to(p_vertices[p_b.edge[0]]))) { return true; } |