diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-09-25 17:42:08 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:03 +0300 |
commit | 520922876a1f7618319038728ca14a18276287d3 (patch) | |
tree | 7bf578e7008568a0912784506b1d32deb95f30d4 /source/blender/blenkernel/BKE_cloth.h | |
parent | 7d4799b41d554e2a2b56928e88a9a4afb4a3ff13 (diff) |
Target calculation for local non-straight rest shapes.
This is more involved than using simple straight bending targets
constructed from the neighboring segments, but necessary for restoring
groomed rest shapes.
The targets are defined by parallel-transporting a coordinate frame
along the hair, which smoothly rotates to avoid sudden twisting (Frenet
frame problem). The rest positions of hair vertices defines the target
vectors relative to the frame. In the deformed motion state the frame
is then recalculated and the targets constructed in world/root space.
Diffstat (limited to 'source/blender/blenkernel/BKE_cloth.h')
-rw-r--r-- | source/blender/blenkernel/BKE_cloth.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index acda9e11265..8a2477aaa15 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -62,6 +62,7 @@ struct PartDeflect; typedef struct ClothHairRoot { float loc[3]; float rot[3][3]; + float rest_target[3]; /* rest target direction for each segment */ } ClothHairRoot; typedef struct ClothSolverResult { @@ -145,6 +146,12 @@ typedef struct ClothSpring { float f[3]; float stiffness; /* stiffness factor from the vertex groups */ float editrestlen; + + /* angular bending spring target and derivatives */ + float target[3]; + float dtarget_dxij[3][3]; + float dtarget_dxkl[3][3]; + float dtarget_dxmn[3][3]; } ClothSpring; @@ -244,6 +251,8 @@ void cloth_clear_cache (struct Object *ob, struct ClothModifierData *clmd, float // needed for cloth.c int cloth_add_spring (struct ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type); +void cloth_parallel_transport_hair_frame(float mat[3][3], float dir_old[3], const float x_cur[3], const float x_new[3]); + //////////////////////////////////////////////// |