diff options
author | Luca Rood <dev@lucarood.com> | 2018-08-29 01:29:37 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2018-08-31 17:33:59 +0300 |
commit | e3d31b8dfbdc3f4412e12fa1594927098ed0654d (patch) | |
tree | abc629afab10eca51ddc52a3d3550cfcc3291565 /source/blender/physics/intern/implicit.h | |
parent | ec3357e03ab1cf3bad48b0460a62761aae206278 (diff) |
Cloth: Componentize forces
This separates cloth stiffness and damping forces into tension,
compression, and shearing components, allowing more control over the
cloth behaviour.
This also adds a bending model selector (although the new bending model
itself is not implemented in this commit). This is because some of the
features implemented here only make sense within the new bending model,
while the old model is kept for compatibility.
This commit makes non-breaking changes, and thus maintains full
compatibility with existing simulations.
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D3655
Diffstat (limited to 'source/blender/physics/intern/implicit.h')
-rw-r--r-- | source/blender/physics/intern/implicit.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/physics/intern/implicit.h b/source/blender/physics/intern/implicit.h index 2eadd3171b0..ffe9dbbec04 100644 --- a/source/blender/physics/intern/implicit.h +++ b/source/blender/physics/intern/implicit.h @@ -50,6 +50,7 @@ extern "C" { #define CLOTH_FORCE_GRAVITY #define CLOTH_FORCE_DRAG #define CLOTH_FORCE_SPRING_STRUCTURAL +#define CLOTH_FORCE_SPRING_SHEAR #define CLOTH_FORCE_SPRING_BEND #define CLOTH_FORCE_SPRING_GOAL #define CLOTH_FORCE_EFFECTORS @@ -114,7 +115,9 @@ void BPH_mass_spring_force_edge_wind(struct Implicit_Data *data, int v1, int v2, void BPH_mass_spring_force_vertex_wind(struct Implicit_Data *data, int v, float radius, const float (*winvec)[3]); /* Linear spring force between two points */ bool BPH_mass_spring_force_spring_linear(struct Implicit_Data *data, int i, int j, float restlen, - float stiffness, float damping, bool no_compress, float clamp_force); + float stiffness_tension, float damping_tension, + float stiffness_compression, float damping_compression, + bool resist_compress, bool new_compress, float clamp_force); /* Bending force, forming a triangle at the base of two structural springs */ bool BPH_mass_spring_force_spring_bending(struct Implicit_Data *data, int i, int j, float restlen, float kb, float cb); /* Angular bending force based on local target vectors */ |