diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-10-09 15:23:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-09 15:23:40 +0200 |
commit | bf12b459864f89d056588c67cd90d0578681146b (patch) | |
tree | 0c201bd368d518db3b3342cacabb2618aba73fed /editor/plugins | |
parent | 438e32d6520c4fc37676bfdc2d287178a13c326c (diff) | |
parent | 70e47996b8fe88ddcd27aa8b796c18af8c2c7e13 (diff) |
Merge pull request #11965 from SaracenOne/navgen_fix
Navmesh Generation Fix
[ci skip]
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/navigation_mesh_generator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/navigation_mesh_generator.cpp b/editor/plugins/navigation_mesh_generator.cpp index 526db3a582..86dc5c3663 100644 --- a/editor/plugins/navigation_mesh_generator.cpp +++ b/editor/plugins/navigation_mesh_generator.cpp @@ -38,9 +38,11 @@ void NavigationMeshGenerator::_add_vertex(const Vector3 &p_vec3, Vector<float> & } void NavigationMeshGenerator::_add_mesh(const Ref<Mesh> &p_mesh, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices) { - int current_vertex_count = p_verticies.size() / 3; + int current_vertex_count = 0; for (int i = 0; i < p_mesh->get_surface_count(); i++) { + current_vertex_count = p_verticies.size() / 3; + if (p_mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) continue; |