diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-04-18 13:48:05 +0200 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-04-18 20:39:43 +0200 |
commit | 71c453a4263d4ae5cd92acdce5901ec5b1978136 (patch) | |
tree | 19123d66466b105cfe28b3c99cd02217b4ff5e6b | |
parent | 06f5b09ca493d1de5dd4bec97bdb6b9ad4fb1d29 (diff) | |
download | redot-engine-71c453a4263d4ae5cd92acdce5901ec5b1978136.tar.gz |
Fix NavigationMesh baking for HeightMapShape
Fixes NavigationMesh baking for HeightMapShape.
-rw-r--r-- | modules/navigation/navigation_mesh_generator.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/navigation/navigation_mesh_generator.cpp b/modules/navigation/navigation_mesh_generator.cpp index 74ff9312fd..fe63d67aba 100644 --- a/modules/navigation/navigation_mesh_generator.cpp +++ b/modules/navigation/navigation_mesh_generator.cpp @@ -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]; @@ -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]; |