summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-10 12:31:59 +0100
committerGitHub <noreply@github.com>2022-01-10 12:31:59 +0100
commit0464db3da8b1cb43942329f5e0af436584b84222 (patch)
tree5abd66f41995eddb1d591fdc5ca2770fd7bd5652 /modules
parentd7464757084099765dee5755b21a8847f4226360 (diff)
parent7f16bed9477e0343bf043498bde6f81e3cc1bd0b (diff)
Merge pull request #56602 from V-Sekai/csg_selection
Diffstat (limited to 'modules')
-rw-r--r--modules/csg/csg_gizmos.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/csg/csg_gizmos.cpp b/modules/csg/csg_gizmos.cpp
index 71891c8704..f6e09067d2 100644
--- a/modules/csg/csg_gizmos.cpp
+++ b/modules/csg/csg_gizmos.cpp
@@ -343,6 +343,16 @@ 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 (p_gizmo->is_selected()) {
// Draw a translucent representation of the CSG node
Ref<ArrayMesh> mesh = memnew(ArrayMesh);