From 5afa4b1dc8aacdd17f72a2bcaccd53838107c229 Mon Sep 17 00:00:00 2001 From: Ish Bosamiya Date: Mon, 2 Mar 2020 10:52:58 -0300 Subject: Fix T65568: sewing and self collision issue As explained in T65568 by @LucaRood, the self collision system should exclude triangles that are connected by sewing springs. Differential Revision: https://developer.blender.org/D6911 --- source/blender/blenkernel/BKE_cloth.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/BKE_cloth.h') diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 039104cf377..883f4a137e7 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -32,6 +32,7 @@ struct Depsgraph; struct Mesh; struct Object; struct Scene; +struct GHash; #define DO_INLINE MALWAYS_INLINE @@ -44,8 +45,8 @@ struct Scene; /* Bits to or into the ClothVertex.flags. */ typedef enum eClothVertexFlag { - CLOTH_VERT_FLAG_PINNED = 1, - CLOTH_VERT_FLAG_NOSELFCOLL = 2, /* vertex NOT used for self collisions */ + CLOTH_VERT_FLAG_PINNED = (1 << 0), + CLOTH_VERT_FLAG_NOSELFCOLL = (1 << 1), /* vertex NOT used for self collisions */ } eClothVertexFlag; typedef struct ClothHairData { @@ -88,8 +89,9 @@ typedef struct Cloth { struct Implicit_Data *implicit; /* our implicit solver connects to this pointer */ struct EdgeSet *edgeset; /* used for selfcollisions */ int last_frame; - float initial_mesh_volume; /* Initial volume of the mesh. Used for pressure */ - struct MEdge *edges; /* Used for hair collisions. */ + float initial_mesh_volume; /* Initial volume of the mesh. Used for pressure */ + struct MEdge *edges; /* Used for hair collisions. */ + struct GHash *sew_edge_graph; /* Sewing edges represented using a GHash */ } Cloth; /** -- cgit v1.2.3