diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-30 10:06:18 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-30 10:06:18 -0300 |
commit | 21939ce08b042b8cfcff16da780a4595aac500cd (patch) | |
tree | 6a6f8dd85426de1863e2802a725e6dc7b2e648bb /scene/2d/navigation2d.cpp | |
parent | 7773d70f449ae8dd66691661fe3ed86d1cabf219 (diff) | |
download | redot-engine-21939ce08b042b8cfcff16da780a4595aac500cd.tar.gz |
-some cleanups
-added tesselation function to curve and curve2d
Diffstat (limited to 'scene/2d/navigation2d.cpp')
-rw-r--r-- | scene/2d/navigation2d.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index e4d10cad12..d427bf4bc3 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -516,7 +516,8 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect apex_poly=p; portal_left=apex_point; portal_right=apex_point; - path.push_back(apex_point); + if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON) + path.push_back(apex_point); skip=true; } } @@ -536,7 +537,8 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect apex_poly=p; portal_right=apex_point; portal_left=apex_point; - path.push_back(apex_point); + if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON) + path.push_back(apex_point); } } @@ -547,7 +549,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect } - if (path[path.size()-1]!=begin_point) + if (path[path.size()-1].distance_to(begin_point)>CMP_EPSILON) path.push_back(begin_point); path.invert(); |