Procházet zdrojové kódy

Fix path post-processing edgecentered

Fixes path post-processing edgecentered.
smix8 před 1 měsícem
rodič
revize
a3f393a3e1

+ 1 - 0
modules/navigation_2d/2d/nav_map_builder_2d.cpp

@@ -126,6 +126,7 @@ void NavMapBuilder2D::_build_step_find_edge_connection_pairs(NavMapIterationBuil
 				// Add the polygon/edge tuple to this key.
 				Connection new_connection;
 				new_connection.polygon = &region->navmesh_polygons[connectable_edge.polygon_index];
+				new_connection.edge = connectable_edge.edge;
 				new_connection.pathway_start = connectable_edge.pathway_start;
 				new_connection.pathway_end = connectable_edge.pathway_end;
 

+ 1 - 0
modules/navigation_2d/2d/nav_region_builder_2d.cpp

@@ -241,6 +241,7 @@ void NavRegionBuilder2D::_build_step_merge_edge_connection_pairs(NavRegionIterat
 			ConnectableEdge ce;
 			ce.ek = pair_it.key;
 			ce.polygon_index = connection.polygon->id;
+			ce.edge = connection.edge;
 			ce.pathway_start = connection.pathway_start;
 			ce.pathway_end = connection.pathway_end;
 

+ 1 - 0
modules/navigation_2d/nav_utils_2d.h

@@ -75,6 +75,7 @@ struct EdgeKey {
 struct ConnectableEdge {
 	EdgeKey ek;
 	uint32_t polygon_index;
+	int edge = -1;
 	Vector2 pathway_start;
 	Vector2 pathway_end;
 };

+ 1 - 0
modules/navigation_3d/3d/nav_map_builder_3d.cpp

@@ -127,6 +127,7 @@ void NavMapBuilder3D::_build_step_find_edge_connection_pairs(NavMapIterationBuil
 				// Add the polygon/edge tuple to this key.
 				Connection new_connection;
 				new_connection.polygon = &region->navmesh_polygons[connectable_edge.polygon_index];
+				new_connection.edge = connectable_edge.edge;
 				new_connection.pathway_start = connectable_edge.pathway_start;
 				new_connection.pathway_end = connectable_edge.pathway_end;
 

+ 1 - 0
modules/navigation_3d/3d/nav_region_builder_3d.cpp

@@ -242,6 +242,7 @@ void NavRegionBuilder3D::_build_step_merge_edge_connection_pairs(NavRegionIterat
 			ConnectableEdge ce;
 			ce.ek = pair_it.key;
 			ce.polygon_index = connection.polygon->id;
+			ce.edge = connection.edge;
 			ce.pathway_start = connection.pathway_start;
 			ce.pathway_end = connection.pathway_end;
 

+ 1 - 0
modules/navigation_3d/nav_utils_3d.h

@@ -76,6 +76,7 @@ struct EdgeKey {
 struct ConnectableEdge {
 	EdgeKey ek;
 	uint32_t polygon_index;
+	int edge = -1;
 	Vector3 pathway_start;
 	Vector3 pathway_end;
 };