Skip to content

Commit 4fe40ac

Browse files
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.
1 parent 0870525 commit 4fe40ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

editor/scene/3d/gizmos/physics/collision_polygon_3d_gizmo_plugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
168168
Vector<Color> cap_colours_bottom;
169169
Vector<int> cap_indices_bottom;
170170

171-
const int index_offset = verts_size;
171+
const int index_offset = verts.size();
172172

173173
const Vector<Vector2> &convex = decomp[i];
174174
const int convex_size = convex.size();
@@ -198,7 +198,7 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
198198
Vector<Color> cap_colours_top;
199199
Vector<int> cap_indices_top;
200200

201-
const int index_offset = verts_size;
201+
const int index_offset = verts.size();
202202

203203
const Vector<Vector2> &convex = decomp[i];
204204
const int convex_size = convex.size();

0 commit comments

Comments
 (0)