[Bf-blender-cvs] [a5c5ae8] hair_system: Don't simulate the hair root.

Lukas Tönne noreply at git.blender.org
Sun Jul 27 19:59:43 CEST 2014


Commit: a5c5ae82cb96a986876f3a2cc0d85bab7a06ad4c
Author: Lukas Tönne
Date:   Sun Jul 27 18:49:02 2014 +0200
Branches: hair_system
https://developer.blender.org/rBa5c5ae82cb96a986876f3a2cc0d85bab7a06ad4c

Don't simulate the hair root.

This enforces the basic root constraint of hair curves. In principle we
could allow free, unconstrained hairs as well ...

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

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 84b6e39..fc76963 100644
--- a/source/blender/hair/intern/HAIR_solver.cpp
+++ b/source/blender/hair/intern/HAIR_solver.cpp
@@ -93,7 +93,7 @@ float3 Solver::calc_velocity(Curve *curve, Point *point, float time, Point::Stat
 
 float3 Solver::calc_acceleration(Curve *curve, Point *point, float time, Point::State &state) const
 {
-	return float3(0.0f, 0.0f, -1.0f);
+	return float3(0.0f, 0.0f, -0.01f);
 }
 
 void Solver::step(float timestep)
@@ -106,7 +106,17 @@ void Solver::step(float timestep)
 	
 	for (i = 0, curve = m_data->curves; i < totcurve; ++i, ++curve) {
 		int numpoints = curve->totpoints;
-		for (k = 0, point = curve->points; k < numpoints; ++k, ++point) {
+		
+		/* Root point animation */
+		k = 0;
+		point = curve->points;
+		
+		// TODO actually evaluate animation here
+		point->next.co = point->cur.co;
+		point->next.vel = float3(0.0f, 0.0f, 0.0f);
+		
+		/* Integrate the remaining free points */
+		for (++k, ++point; k < numpoints; ++k, ++point) {
 			float3 acc = calc_acceleration(curve, point, 0.0f, point->cur);
 			point->next.vel = point->cur.vel + acc * timestep;




More information about the Bf-blender-cvs mailing list