Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-02-20 18:54:34 +0300
committerDaniel Genrich <daniel.genrich@gmx.net>2008-02-20 18:54:34 +0300
commite3e268253d5d4dc71ca530c744870b3b8ed710d9 (patch)
tree31e1c230b02348e6f1296021ceda1597f8761ffb /source/blender/blenkernel/intern/cloth.c
parentdc9fafd7a6016a86f166914cea97423392dcf580 (diff)
Cloth: Bugfix for wrong number of bending springs, could result in visual artifacts
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r--source/blender/blenkernel/intern/cloth.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 802e14b683f..ec128bc3a02 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -1210,7 +1210,6 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
EdgeHash *edgehash = NULL;
LinkNode *search = NULL, *search2 = NULL;
float temp[3];
- LinkNode *node = NULL, *node2 = NULL;
// error handling
if ( numedges==0 )
@@ -1251,11 +1250,7 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring->stiffness = (cloth->verts[spring->kl].struct_stiff + cloth->verts[spring->ij].struct_stiff) / 2.0;
struct_springs++;
- if(!i)
- node2 = BLI_linklist_append_fast ( &cloth->springs, spring );
- else
- node2 = BLI_linklist_append_fast ( &node->next, spring );
- node = node2;
+ BLI_linklist_prepend ( &cloth->springs, spring );
}
}
@@ -1282,8 +1277,7 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_linklist_append ( &edgelist[spring->kl], spring );
shear_springs++;
- node2 = BLI_linklist_append_fast ( &node->next, spring );
- node = node2;
+ BLI_linklist_prepend ( &cloth->springs, spring );
if ( mface[i].v4 )
{
@@ -1300,8 +1294,7 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_linklist_append ( &edgelist[spring->kl], spring );
shear_springs++;
- node2 = BLI_linklist_append_fast ( &node->next, spring );
- node = node2;
+ BLI_linklist_prepend ( &cloth->springs, spring );
}
}
@@ -1336,8 +1329,7 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_edgehash_insert ( edgehash, spring->ij, index2, NULL );
bend_springs++;
- node2 = BLI_linklist_append_fast ( &node->next, spring );
- node = node2;
+ BLI_linklist_prepend ( &cloth->springs, spring );
}
search = search->next;
}