Skip to content

Commit

Permalink
Changed the orientation of generated NavigationMeshes
Browse files Browse the repository at this point in the history
Now the faces of a navigation mesh point towards the specified "up"
vector, as intended.

Fixes godotengine#23817
  • Loading branch information
needleful committed Nov 19, 2018
1 parent 35fbbeb commit db80dd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/recast/navigation_mesh_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ void NavigationMeshGenerator::_convert_detail_mesh_to_native_navigation_mesh(con
for (unsigned int j = 0; j < ntris; j++) {
Vector<int> nav_indices;
nav_indices.resize(3);
// CCW to CW
nav_indices.write[0] = ((int)(bverts + tris[j * 4 + 0]));
nav_indices.write[1] = ((int)(bverts + tris[j * 4 + 1]));
nav_indices.write[2] = ((int)(bverts + tris[j * 4 + 2]));
nav_indices.write[1] = ((int)(bverts + tris[j * 4 + 2]));
nav_indices.write[2] = ((int)(bverts + tris[j * 4 + 1]));
p_nav_mesh->add_polygon(nav_indices);
}
}
Expand Down

0 comments on commit db80dd4

Please sign in to comment.