[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13784] trunk/blender/source/blender/ blenkernel/intern/cloth.c: Cloth: Bugfix for wrong number of bending springs, could result in visual artifacts

Daniel Genrich daniel.genrich at gmx.net
Wed Feb 20 16:54:34 CET 2008


Revision: 13784
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13784
Author:   genscher
Date:     2008-02-20 16:54:34 +0100 (Wed, 20 Feb 2008)

Log Message:
-----------
Cloth: Bugfix for wrong number of bending springs, could result in visual artifacts

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/cloth.c

Modified: trunk/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cloth.c	2008-02-20 14:54:17 UTC (rev 13783)
+++ trunk/blender/source/blender/blenkernel/intern/cloth.c	2008-02-20 15:54:34 UTC (rev 13784)
@@ -1210,7 +1210,6 @@
 	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 @@
 			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 @@
 		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 @@
 			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 @@
 				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;
 		}





More information about the Bf-blender-cvs mailing list