summaryrefslogtreecommitdiff
path: root/scene/2d/navigation_region_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/navigation_region_2d.cpp')
-rw-r--r--scene/2d/navigation_region_2d.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp
index 72dc8bd9ad..7360fce330 100644
--- a/scene/2d/navigation_region_2d.cpp
+++ b/scene/2d/navigation_region_2d.cpp
@@ -37,7 +37,7 @@
#include "navigation_2d.h"
#include "servers/navigation_server_2d.h"
-#include "thirdparty/misc/triangulator.h"
+#include "thirdparty/misc/polypartition.h"
#ifdef TOOLS_ENABLED
Rect2 NavigationPolygon::_edit_get_rect() const {
@@ -228,7 +228,7 @@ void NavigationPolygon::make_polygons_from_outlines() {
MutexLock lock(navmesh_generation);
navmesh.unref();
}
- List<TriangulatorPoly> in_poly, out_poly;
+ List<TPPLPoly> in_poly, out_poly;
Vector2 outside_point(-1e10, -1e10);
@@ -278,23 +278,23 @@ void NavigationPolygon::make_polygons_from_outlines() {
bool outer = (interscount % 2) == 0;
- TriangulatorPoly tp;
+ TPPLPoly tp;
tp.Init(olsize);
for (int j = 0; j < olsize; j++) {
tp[j] = r[j];
}
if (outer) {
- tp.SetOrientation(TRIANGULATOR_CCW);
+ tp.SetOrientation(TPPL_ORIENTATION_CCW);
} else {
- tp.SetOrientation(TRIANGULATOR_CW);
+ tp.SetOrientation(TPPL_ORIENTATION_CW);
tp.SetHole(true);
}
in_poly.push_back(tp);
}
- TriangulatorPartition tpart;
+ TPPLPartition tpart;
if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { //failed!
ERR_PRINT("NavigationPolygon: Convex partition failed!");
return;
@@ -304,8 +304,8 @@ void NavigationPolygon::make_polygons_from_outlines() {
vertices.resize(0);
Map<Vector2, int> points;
- for (List<TriangulatorPoly>::Element *I = out_poly.front(); I; I = I->next()) {
- TriangulatorPoly &tp = I->get();
+ for (List<TPPLPoly>::Element *I = out_poly.front(); I; I = I->next()) {
+ TPPLPoly &tp = I->get();
struct Polygon p;