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-19 18:53:35 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:02 +0300
commit00bb836e17de349b7e4f9478b1911f8de8e0b334 (patch)
tree0cc3d925cbc772c48ff7710229e34b24dcfb1c0e /source/blender/blenkernel/intern/cloth.c
parente5ae13b809df309569878d2c36f85b695aaf0992 (diff)
Calculate bending targets based on the direction of previous segments.
This makes the bending a truely local effect. Eventually target directions should be based in a local coordinate frame that gets parallel transported along the curve. This will allow non-straight rest shapes for hairs as well as supporting twist forces. However, calculating locally transformed spring forces is more complicated.
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r--source/blender/blenkernel/intern/cloth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 1b3b668f524..284107ee4e8 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -1302,9 +1302,9 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
return 0;
}
- spring->ij = tspring->kl;
+ spring->ij = tspring2->ij;
spring->kl = tspring->ij;
- spring->mn = tspring2->ij;
+ spring->mn = tspring->kl;
spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
spring->type = CLOTH_SPRING_TYPE_BENDING_ANG;
spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0f;