Godot Version
4.2.1
Question
Hello, community!
First, sorry my english and the fact that new users can only add one media to the post…
ALL prints can be see here, please
I’m working on navigation/procedurally generated mesh, and to me this is strange behavior:
In the code below, I created a var named bounding_outline_1 with the same points that exist in var bounding_outline_2, but in a different insertion order, the results obtained during execution are different…
Points in differrent order:
Executions results:
A) Parabounding_outline_1 I had two triangles for navigation…
B) Parabounding_outline_2 I had a square…
Is this a bug?
Is there a rule for the correct order of adding points?
Code:
func teste05():
var new_navigation_mesh = NavigationPolygon.new()
var bounding_outline_1 = PackedVector2Array([Vector2(0, 0), Vector2(320, 0), Vector2(0, 320), Vector2(320, 320)])
var bounding_outline_2 = PackedVector2Array([Vector2(0, 0), Vector2(0, 320), Vector2(320, 320), Vector2(320, 0)])
new_navigation_mesh.add_outline(bounding_outline_1)
#new_navigation_mesh.add_outline(bounding_outline_2)
NavigationServer2D.bake_from_source_geometry_data(new_navigation_mesh, NavigationMeshSourceGeometryData2D.new());
$".".navigation_polygon = new_navigation_mesh
Code print:
Execution results mesh result:
A) With line 146 commented
B) with line 145 commented