Skip to content

Commit

Permalink
Merge pull request #76212 from smix8/fix_heightmap_navmesh_4,x
Browse files Browse the repository at this point in the history
Fix NavigationMesh baking for HeightMapShape
  • Loading branch information
akien-mga committed Apr 18, 2023
2 parents 5bb46d6 + 71c453a commit 1b4b893
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/navigation/navigation_mesh_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ void NavigationMeshGenerator::_parse_geometry(const Transform3D &p_navmesh_trans
vertex_array.resize((heightmap_depth - 1) * (heightmap_width - 1) * 6);
int map_data_current_index = 0;

for (int d = 0; d < heightmap_depth - 1; d++) {
for (int w = 0; w < heightmap_width - 1; w++) {
for (int d = 0; d < heightmap_depth; d++) {
for (int w = 0; w < heightmap_width; w++) {
if (map_data_current_index + 1 + heightmap_depth < map_data.size()) {
float top_left_height = map_data[map_data_current_index];
float top_right_height = map_data[map_data_current_index + 1];
Expand Down Expand Up @@ -422,8 +422,8 @@ void NavigationMeshGenerator::_parse_geometry(const Transform3D &p_navmesh_trans
vertex_array.resize((heightmap_depth - 1) * (heightmap_width - 1) * 6);
int map_data_current_index = 0;

for (int d = 0; d < heightmap_depth - 1; d++) {
for (int w = 0; w < heightmap_width - 1; w++) {
for (int d = 0; d < heightmap_depth; d++) {
for (int w = 0; w < heightmap_width; w++) {
if (map_data_current_index + 1 + heightmap_depth < map_data.size()) {
float top_left_height = map_data[map_data_current_index];
float top_right_height = map_data[map_data_current_index + 1];
Expand Down

0 comments on commit 1b4b893

Please sign in to comment.