summaryrefslogtreecommitdiff
path: root/modules/csg/csg.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2019-10-02 16:31:09 -0400
committerAaron Franke <arnfranke@yahoo.com>2019-10-14 16:47:42 -0400
commitaeb70756287ad209f0b9d799bcd157dcaed41c17 (patch)
treee3392dfb99cc30f08f6f6b5f975289214fa81bec /modules/csg/csg.cpp
parent86922ff70ba533b376a6680f965f542894e8c614 (diff)
Replace vector == and is_zero_approx(distance) with is_equal_approx
Internal changes only
Diffstat (limited to 'modules/csg/csg.cpp')
-rw-r--r--modules/csg/csg.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index 5a76f32977..925fff0cc8 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -242,7 +242,7 @@ void CSGBrushOperation::BuildPoly::_clip_segment(const CSGBrush *p_brush, int p_
//check if edge and poly share a vertex, of so, assign it to segment_idx
for (int i = 0; i < points.size(); i++) {
for (int j = 0; j < 2; j++) {
- if (segment[j] == points[i].point) {
+ if (segment[j].is_equal_approx(points[i].point)) {
segment_idx[j] = i;
inserted_points.push_back(i);
break;
@@ -310,7 +310,7 @@ void CSGBrushOperation::BuildPoly::_clip_segment(const CSGBrush *p_brush, int p_
Vector2 edgeseg[2] = { points[edges[i].points[0]].point, points[edges[i].points[1]].point };
Vector2 closest = Geometry::get_closest_point_to_segment_2d(segment[j], edgeseg);
- if (closest == segment[j]) {
+ if (closest.is_equal_approx(segment[j])) {
//point rest of this edge
res = closest;
found = true;
@@ -439,7 +439,7 @@ void CSGBrushOperation::BuildPoly::clip(const CSGBrush *p_brush, int p_face, Mes
//transform A points to 2D
- if (segment[0] == segment[1])
+ if (segment[0].is_equal_approx(segment[1]))
return; //too small
_clip_segment(p_brush, p_face, segment, mesh_merge, p_for_B);
@@ -461,10 +461,10 @@ void CSGBrushOperation::_collision_callback(const CSGBrush *A, int p_face_a, Map
{
//check if either is a degenerate
- if (va[0] == va[1] || va[0] == va[2] || va[1] == va[2])
+ if (va[0].is_equal_approx(va[1]) || va[0].is_equal_approx(va[2]) || va[1].is_equal_approx(va[2]))
return;
- if (vb[0] == vb[1] || vb[0] == vb[2] || vb[1] == vb[2])
+ if (vb[0].is_equal_approx(vb[1]) || vb[0].is_equal_approx(vb[2]) || vb[1].is_equal_approx(vb[2]))
return;
}