浏览代码

Exclude disabled CollisionShapes from Navigationmesh baking

Excludes disabled CollisionShapes from the geometry parsing for the NavigationMesh baking.

(cherry picked from commit 534ff93b05446f5692bcee95f51400c211b080ff)
smix8 3 年之前
父节点
当前提交
729d7b2b42
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      modules/navigation/navigation_mesh_generator.cpp

+ 3 - 0
modules/navigation/navigation_mesh_generator.cpp

@@ -211,6 +211,9 @@ void NavigationMeshGenerator::_parse_geometry(const Transform &p_navmesh_xform,
 				uint32_t shape_owner = E->get();
 				const int shape_count = static_body->shape_owner_get_shape_count(shape_owner);
 				for (int i = 0; i < shape_count; i++) {
+					if (static_body->is_shape_owner_disabled(i)) {
+						continue;
+					}
 					Ref<Shape> s = static_body->shape_owner_get_shape(shape_owner, i);
 					if (s.is_null()) {
 						continue;