diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-27 12:54:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 12:54:29 +0200 |
commit | e2f29a431289744405f909c2ad6799f431fa3a14 (patch) | |
tree | b1e3163130a22df7c34893efe951f4d577409882 | |
parent | baeb8ad860aa9a14944f206e0aeaf276d6766ed1 (diff) | |
parent | 60f3d1d36fc81ec23c88f5414c03ac17993432e9 (diff) |
Merge pull request #59381 from gaudecker/fix-csg-gizmos
-rw-r--r-- | modules/csg/editor/csg_gizmos.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/modules/csg/editor/csg_gizmos.cpp b/modules/csg/editor/csg_gizmos.cpp index be29810252..4d972e46c6 100644 --- a/modules/csg/editor/csg_gizmos.cpp +++ b/modules/csg/editor/csg_gizmos.cpp @@ -347,14 +347,12 @@ void CSGShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_lines(lines, material); p_gizmo->add_collision_segments(lines); - Array csg_meshes = cs->get_meshes(); - if (csg_meshes.size() != 2) { - return; - } - - Ref<Mesh> csg_mesh = csg_meshes[1]; - if (csg_mesh.is_valid()) { - p_gizmo->add_collision_triangles(csg_mesh->generate_triangle_mesh()); + if (cs->is_root_shape()) { + Array csg_meshes = cs->get_meshes(); + Ref<Mesh> csg_mesh = csg_meshes[1]; + if (csg_mesh.is_valid()) { + p_gizmo->add_collision_triangles(csg_mesh->generate_triangle_mesh()); + } } if (p_gizmo->is_selected()) { |