From 4fe40ac07e72f51c5ec3e8fe8bd8ca2ac366d784 Mon Sep 17 00:00:00 2001 From: Michael Moore Date: Sat, 1 Nov 2025 09:38:58 -0500 Subject: [PATCH] Fixing CollisionPolygon3D debug shape rendering. When a CollisionPolygon3D is drawn with a concave area, it fails to render the surface of the top and bottom. Steps to reproduce the bug in the editor: 1. Create a new scene 2. Create CollisionPolygon3D 3. Make sure debug fill is checked in the CollisionPolygon3D inspector. 4. Add these vertices to the the polygon (0,0), (1,-1), (1,1), (-1, 1), (-1, 0.3). You should see that only one triangle from the top and bottom of the polygon is drawn and the reset are missing. --- .../3d/gizmos/physics/collision_polygon_3d_gizmo_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/scene/3d/gizmos/physics/collision_polygon_3d_gizmo_plugin.cpp b/editor/scene/3d/gizmos/physics/collision_polygon_3d_gizmo_plugin.cpp index 34a5ecc820b..5300ecd6b1f 100644 --- a/editor/scene/3d/gizmos/physics/collision_polygon_3d_gizmo_plugin.cpp +++ b/editor/scene/3d/gizmos/physics/collision_polygon_3d_gizmo_plugin.cpp @@ -168,7 +168,7 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Vector cap_colours_bottom; Vector cap_indices_bottom; - const int index_offset = verts_size; + const int index_offset = verts.size(); const Vector &convex = decomp[i]; const int convex_size = convex.size(); @@ -198,7 +198,7 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Vector cap_colours_top; Vector cap_indices_top; - const int index_offset = verts_size; + const int index_offset = verts.size(); const Vector &convex = decomp[i]; const int convex_size = convex.size();