diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-09-19 13:15:16 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:02 +0300 |
commit | 7a7778d003d1a31fb4eb3411e1b0512981cc4614 (patch) | |
tree | 0488266c11cbaf505c02de1eb34bcaf42486e1d4 /source/blender/physics/intern/implicit.h | |
parent | 86a4da1c5416c36d2e860720d474f394146ecc2d (diff) |
Simple initial implementation of angular bending springs.
These are much better suited for creating stiff hair. The previous
bending springs are based on "push" type spring along the hypothenuse
of 3 hair vertices. This sort of spring requires a very large force
in the direction of the spring for any angular effect, and is still
unstable in the equilibrium.
The new bending spring model is based on "target" vectors defined in a
local hair frame, which generates a force perpendicular to the hair
segment. For further details see
"Artistic Simulation of Curly Hair" (Pixar technical memo #12-03a)
or
"A Mass Spring Model for Hair Simulation" (Selle, Lentine, Fedkiw 2008)
Currently the implementation uses a single root frame that is not yet
propagated along the hair, so the resulting rest shape is not very
natural. Also damping and derivatives are still missing.
Diffstat (limited to 'source/blender/physics/intern/implicit.h')
-rw-r--r-- | source/blender/physics/intern/implicit.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/physics/intern/implicit.h b/source/blender/physics/intern/implicit.h index 3743152cc79..ea9a5b8211a 100644 --- a/source/blender/physics/intern/implicit.h +++ b/source/blender/physics/intern/implicit.h @@ -140,6 +140,10 @@ bool BPH_mass_spring_force_spring_linear(struct Implicit_Data *data, int i, int bool BPH_mass_spring_force_spring_bending(struct Implicit_Data *data, int i, int j, int spring_index, float restlen, float kb, float cb, float r_f[3], float r_dfdx[3][3], float r_dfdv[3][3]); +/* Angular bending force based on local target vectors */ +bool BPH_mass_spring_force_spring_bending_angular(struct Implicit_Data *data, int i, int j, int spring_index, float restlen, + float stiffness, float damping, + float r_f[3], float r_dfdx[3][3], float r_dfdv[3][3]); /* Global goal spring */ bool BPH_mass_spring_force_spring_goal(struct Implicit_Data *data, int i, int spring_index, const float goal_x[3], const float goal_v[3], float stiffness, float damping, |