diff options
Diffstat (limited to 'modules/recast')
-rw-r--r-- | modules/recast/navigation_mesh_generator.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/modules/recast/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp index 29f5e4c363..80e98a13a5 100644 --- a/modules/recast/navigation_mesh_generator.cpp +++ b/modules/recast/navigation_mesh_generator.cpp @@ -66,26 +66,26 @@ void NavigationMeshGenerator::_add_mesh(const Ref<Mesh> &p_mesh, const Transform PoolVector<int> mesh_indices = a[Mesh::ARRAY_INDEX]; PoolVector<int>::Read ir = mesh_indices.read(); - for (int i = 0; i < mesh_vertices.size(); i++) { - _add_vertex(p_xform.xform(vr[i]), p_verticies); + for (int j = 0; j < mesh_vertices.size(); j++) { + _add_vertex(p_xform.xform(vr[j]), p_verticies); } - for (int i = 0; i < face_count; i++) { + for (int j = 0; j < face_count; j++) { // CCW - p_indices.push_back(current_vertex_count + (ir[i * 3 + 0])); - p_indices.push_back(current_vertex_count + (ir[i * 3 + 2])); - p_indices.push_back(current_vertex_count + (ir[i * 3 + 1])); + p_indices.push_back(current_vertex_count + (ir[j * 3 + 0])); + p_indices.push_back(current_vertex_count + (ir[j * 3 + 2])); + p_indices.push_back(current_vertex_count + (ir[j * 3 + 1])); } } else { face_count = mesh_vertices.size() / 3; - for (int i = 0; i < face_count; i++) { - _add_vertex(p_xform.xform(vr[i * 3 + 0]), p_verticies); - _add_vertex(p_xform.xform(vr[i * 3 + 2]), p_verticies); - _add_vertex(p_xform.xform(vr[i * 3 + 1]), p_verticies); - - p_indices.push_back(current_vertex_count + (i * 3 + 0)); - p_indices.push_back(current_vertex_count + (i * 3 + 1)); - p_indices.push_back(current_vertex_count + (i * 3 + 2)); + for (int j = 0; j < face_count; j++) { + _add_vertex(p_xform.xform(vr[j * 3 + 0]), p_verticies); + _add_vertex(p_xform.xform(vr[j * 3 + 2]), p_verticies); + _add_vertex(p_xform.xform(vr[j * 3 + 1]), p_verticies); + + p_indices.push_back(current_vertex_count + (j * 3 + 0)); + p_indices.push_back(current_vertex_count + (j * 3 + 1)); + p_indices.push_back(current_vertex_count + (j * 3 + 2)); } } } |