1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

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.
This commit is contained in:
Michael Moore
2025-11-01 09:38:58 -05:00
parent 08705259f2
commit 4fe40ac07e

View File

@@ -168,7 +168,7 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Vector<Color> cap_colours_bottom;
Vector<int> cap_indices_bottom;
const int index_offset = verts_size;
const int index_offset = verts.size();
const Vector<Vector2> &convex = decomp[i];
const int convex_size = convex.size();
@@ -198,7 +198,7 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Vector<Color> cap_colours_top;
Vector<int> cap_indices_top;
const int index_offset = verts_size;
const int index_offset = verts.size();
const Vector<Vector2> &convex = decomp[i];
const int convex_size = convex.size();