Commit: e843c10ad54bcc4f34d0900f407749e09562fba5
Author: Luca Rood
Date:   Thu Dec 15 15:21:29 2016 -0200
Branches: cloth-improvements
https://developer.blender.org/rBe843c10ad54bcc4f34d0900f407749e09562fba5

Fixed some typos, and missing initializations

===================================================================

M       source/blender/physics/intern/BPH_mass_spring.cpp
M       source/blender/physics/intern/implicit_blender.c

===================================================================

diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp 
b/source/blender/physics/intern/BPH_mass_spring.cpp
index dbebc6b..f1a472b 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -363,8 +363,8 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData 
*clmd, ClothSpring *s,
 
                        // TODO: verify, half verified (couldn't see error)
                        // sewing springs usually have a large distance at 
first so clamp the force so we don't get tunnelling through colission objects
-                       BPH_mass_spring_force_spring_linear(data, s->ij, s->kl, 
s->restlen, k_tension, 0,
-                                                           d_tension, 0, 
no_compress, parms->max_sewing);
+                       BPH_mass_spring_force_spring_linear(data, s->ij, s->kl, 
s->restlen, k_tension, 0.0f,
+                                                           d_tension, 0.0f, 
no_compress, parms->max_sewing);
                }
                else {
                        scaling_compression = parms->compression + s->stiffness 
* fabsf(parms->max_compression - parms->compression);
@@ -379,7 +379,7 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData 
*clmd, ClothSpring *s,
                                // Multiply by some arbitrary large value, just 
so zero-length springs have enough force.
                                k_tension = scaling_tension * 10000;
                                k_compression = 0; // No compression for 
zero-length springs
-                               d_tension = parms->tension_damp * 1000;
+                               d_tension = parms->tension_damp * 10000;
                                d_compression = 0;
                        }
 
@@ -405,7 +405,7 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData 
*clmd, ClothSpring *s,
                        d = parms->shear_damp * 10000;
                }
 
-               BPH_mass_spring_force_spring_linear(data, s->ij, s->kl, 
s->restlen, k, 0.0f, d, 0.0f, no_compress, 0.0f);
+               BPH_mass_spring_force_spring_linear(data, s->ij, s->kl, 
s->restlen, k, 0.0f, d, 0.0f, true, 0.0f);
 #endif
        }
        else if (s->type & CLOTH_SPRING_TYPE_GOAL) {
diff --git a/source/blender/physics/intern/implicit_blender.c 
b/source/blender/physics/intern/implicit_blender.c
index d7b984a..141c0df 100644
--- a/source/blender/physics/intern/implicit_blender.c
+++ b/source/blender/physics/intern/implicit_blender.c
@@ -1616,6 +1616,10 @@ bool BPH_mass_spring_force_spring_linear(Implicit_Data 
*data, int i, int j, floa
                outerproduct(dfdx, dir, dir);
                mul_m3_fl(dfdx, fbstar_jacobi(length, restlen, kb, cb));
        }
+       else {
+               zero_v3(f);
+               zero_m3(dfdx);
+       }
 
        /* Calculate damping forces */
        madd_v3_v3fl(f, dir, damping * dot_v3v3(vel, dir));

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to