fix for homegrown bug in softbody rigidity
authorJens Ole Wund <bjornmose@gmx.net>
Wed, 27 Sep 2006 06:59:27 +0000 (06:59 +0000)
committerJens Ole Wund <bjornmose@gmx.net>
Wed, 27 Sep 2006 06:59:27 +0000 (06:59 +0000)
springs inserted twice caused unreal stiffness in ODEs
-> bad performance killers

source/blender/blenkernel/intern/softbody.c

index 06b285fb0e88cde8c86cf8e8541dbb6f1ab9336b..ada8fb5cc21abd5d57eb559b292c7c67eadb3ccc 100644 (file)
@@ -655,6 +655,11 @@ static void build_bps_springlist(Object *ob)
        if (sb==NULL) return; /* paranoya check */
        
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+               /* throw away old list */
+               if (bp->springs) {
+                       MEM_freeN(bp->springs);
+                       bp->springs=NULL;
+               }
                /* scan for attached inner springs */   
                for(b=sb->totspring, bs= sb->bspring; b>0; b--, bs++) {
                        if (( (sb->totpoint-a) == bs->v1) ){