Radical simplification of the wind effect on hair, since the previous

approach does not work very well.

Using a cross section estimate still causes large oscillations due to
varying hair force based on angles. It also requires a sensible hair
thickness value (particle radius) which is difficult to control and
visualize at this point.

The new model is based purely on per-vertex forces, which seems to be
much more stable. It's also somewhat justified by the fact that each
hair vertex represents a certain mass.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
This commit is contained in:
2014-12-18 13:52:31 +01:00
parent f0e8690526
commit db2ac79fc7
3 changed files with 25 additions and 1 deletions

View File

@@ -497,6 +497,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), ListB
/* Hair has only edges */
if (cloth->numfaces == 0) {
#if 0
ClothHairData *hairdata = clmd->hairdata;
ClothHairData *hair_ij, *hair_kl;
@@ -508,6 +509,16 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), ListB
BPH_mass_spring_force_edge_wind(data, spring->ij, spring->kl, hair_ij->radius, hair_kl->radius, winvec);
}
}
#else
ClothHairData *hairdata = clmd->hairdata;
vert = cloth->verts;
for (i = 0; i < cloth->numverts; i++, vert++) {
ClothHairData *hair = &hairdata[i];
BPH_mass_spring_force_vertex_wind(data, i, hair->radius, winvec);
}
#endif
MEM_freeN(winvec);
}