diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-13 21:52:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-13 21:52:38 +0100 |
commit | 0e3aae00d88848f9e840f940959f2ecd05ed7a8a (patch) | |
tree | 47017797d7fa2c2a0c302909992968dcd125ca9a | |
parent | 0444f5ac479f25c10cf9667688fc5b359f87c2dd (diff) | |
parent | 29e67101db061aed5e2536e6613c863a83c42b71 (diff) |
Merge pull request #46919 from nekomatata/soft-body-gizmo-fix
Fix pinned vertices in SoftBody editor gizmo
-rw-r--r-- | editor/node_3d_editor_gizmos.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index 16eefb1ad3..64cf9a7bb7 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -2073,7 +2073,13 @@ void SoftBody3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Ref<TriangleMesh> tm = soft_body->get_mesh()->generate_triangle_mesh(); Vector<Vector3> points; - soft_body->get_mesh()->generate_debug_mesh_indices(points); + for (int i = 0; i < soft_body->get_mesh()->get_surface_count(); i++) { + Array arrays = soft_body->get_mesh()->surface_get_arrays(i); + ERR_CONTINUE(arrays.is_empty()); + + const Vector<Vector3> &vertices = arrays[Mesh::ARRAY_VERTEX]; + points.append_array(vertices); + } Ref<Material> material = get_material("shape_material", p_gizmo); |