summaryrefslogtreecommitdiff
path: root/modules/navigation/nav_map.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-07-16 13:19:55 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-07-21 00:32:37 -0400
commit78b0a7da0398dc8c6447b1439a6d07059311c028 (patch)
tree662e06b568e52c1942a95e0dcff5eff72ede0009 /modules/navigation/nav_map.cpp
parente248d2629ab9cb1dcfa91af5202af4f17754e44f (diff)
Use is_equal_approx in more places
Diffstat (limited to 'modules/navigation/nav_map.cpp')
-rw-r--r--modules/navigation/nav_map.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index 41306f0687..3150ca0bc8 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -734,7 +734,7 @@ void NavMap::dispatch_callbacks() {
void NavMap::clip_path(const std::vector<gd::NavigationPoly> &p_navigation_polys, Vector<Vector3> &path, const gd::NavigationPoly *from_poly, const Vector3 &p_to_point, const gd::NavigationPoly *p_to_poly) const {
Vector3 from = path[path.size() - 1];
- if (from.distance_to(p_to_point) < CMP_EPSILON) {
+ if (from.is_equal_approx(p_to_point)) {
return;
}
Plane cut_plane;
@@ -752,10 +752,10 @@ void NavMap::clip_path(const std::vector<gd::NavigationPoly> &p_navigation_polys
ERR_FAIL_COND(from_poly->back_navigation_poly_id == -1);
from_poly = &p_navigation_polys[from_poly->back_navigation_poly_id];
- if (pathway_start.distance_to(pathway_end) > CMP_EPSILON) {
+ if (!pathway_start.is_equal_approx(pathway_end)) {
Vector3 inters;
if (cut_plane.intersects_segment(pathway_start, pathway_end, &inters)) {
- if (inters.distance_to(p_to_point) > CMP_EPSILON && inters.distance_to(path[path.size() - 1]) > CMP_EPSILON) {
+ if (!inters.is_equal_approx(p_to_point) && !inters.is_equal_approx(path[path.size() - 1])) {
path.push_back(inters);
}
}