Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2014-09-26 01:19:20 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:03 +0300
commit577150c635f4f9339819b1ca9d3587d6809e01e9 (patch)
tree4f6f97132d9e6287df1c64fda225ab73985cc9c0 /source/blender/blenkernel/intern/particle_system.c
parent520922876a1f7618319038728ca14a18276287d3 (diff)
Completed the implementation of bent rest shapes for hair.
Basically follows the Pixar approach from "Artistic Simulation of Curly Hair".
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 661e0c5c1be..a840b740068 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4083,7 +4083,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
/* make vgroup for pin roots etc.. */
psys->particles->hair_index = 1;
LOOP_PARTICLES {
- float root_mat[4][4], hair_frame[3][3], dir[3];
+ float root_mat[4][4];
bool use_hair = psys_hair_use_simulation(pa, max_length);
if (p)
@@ -4093,13 +4093,6 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
mul_m4_m4m4(root_mat, sim->ob->obmat, hairmat);
normalize_m4(root_mat);
- /* initial hair frame from root orientation */
- copy_m3_m4(hair_frame, root_mat);
- /* surface normal is the initial direction,
- * parallel transport then keeps it aligned to the hair direction
- */
- copy_v3_v3(dir, hair_frame[2]);
-
for (k=0, key=pa->hair; k<pa->totkey; k++,key++) {
ClothHairRoot *root;
@@ -4111,10 +4104,6 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
copy_v3_v3(root->loc, root_mat[3]);
copy_m3_m4(root->rot, root_mat);
- /* dir expressed in the hair frame defines the rest target direction */
- copy_v3_v3(root->rest_target, dir);
- mul_transposed_m3_v3(hair_frame, root->rest_target);
-
sub_v3_v3v3(temp, key->co, (key+1)->co);
copy_v3_v3(mvert->co, key->co);
add_v3_v3v3(mvert->co, mvert->co, temp);
@@ -4133,14 +4122,6 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
copy_v3_v3(root->loc, root_mat[3]);
copy_m3_m4(root->rot, root_mat);
- if (k < pa->totkey-1)
- /* move frame to next hair segment */
- cloth_parallel_transport_hair_frame(hair_frame, dir, key->co, (key+1)->co);
-
- /* dir expressed in the hair frame defines the rest target direction */
- copy_v3_v3(root->rest_target, dir);
- mul_transposed_m3_v3(hair_frame, root->rest_target);
-
copy_v3_v3(mvert->co, key->co);
mul_m4_v3(hairmat, mvert->co);
mvert++;