[Bf-blender-cvs] [44ace84] hair_system: Fix for stretch forces, were disabled by merge error.

Lukas Tönne noreply at git.blender.org
Thu Aug 7 22:59:59 CEST 2014


Commit: 44ace849d8da8bac0558a7e3fae3bbe9676d7972
Author: Lukas Tönne
Date:   Thu Aug 7 22:27:26 2014 +0200
Branches: hair_system
https://developer.blender.org/rB44ace849d8da8bac0558a7e3fae3bbe9676d7972

Fix for stretch forces, were disabled by merge error.

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

M	source/blender/hair/intern/HAIR_solver.cpp

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

diff --git a/source/blender/hair/intern/HAIR_solver.cpp b/source/blender/hair/intern/HAIR_solver.cpp
index 84b5753..a1f2fa2 100644
--- a/source/blender/hair/intern/HAIR_solver.cpp
+++ b/source/blender/hair/intern/HAIR_solver.cpp
@@ -209,10 +209,8 @@ static float3 calc_velocity(Curve *curve, Point *point, float time, Point::State
 
 static float3 calc_stretch_force(const HairParams &params, const Point *point0, const Point *point1, float time)
 {
+	float rest_length = len_v3(point1->rest_co - point0->rest_co);
 	float3 dir;
-	float3 edge = point1->cur.co - point0->cur.co;
-	normalize_v3_v3(dir, edge);
-	float rest_length = len_v3(edge);
 	float length = normalize_v3_v3(dir, point1->cur.co - point0->cur.co);
 	
 	return params.stretch_stiffness * (length - rest_length) * dir;




More information about the Bf-blender-cvs mailing list