diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-09 22:09:41 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-09 22:09:41 +0300 |
commit | 9231ff41604039ca55f1da4945a077cfab9e1e84 (patch) | |
tree | c9c29bb10aabaa44e8e683bab8d3ce7a06a39744 /source/blender/makesdna/DNA_particle_types.h | |
parent | 84a464ab62e67eb21e12d0c3b0fad061c38d9e4a (diff) |
Viscoelastic springs for sph particle fluids, original patch by Stephen Whitehorn (chickencoop)
* Viscoelastic springs between the fluid particles can simulate all kinds
of viscous and elastic substances, such as jelly and honey. This is
achieved by creating springs dynamically between neighboring particles
and adjusting their rest length based on stretching/compression.
* This nearly completes the currently intended functionality for particle
fluids. The last missing thing is a surfacing extraction algorithm,
which is needed for a proper representation of a sph fluid.
* I also cleaned up and renamed some of the fluid parameters to make the
ui a bit easier to understand.
* One addition to the patch is an option to use "initial rest length" for
the springs, which uses the lengths between the particles at the time of
spring creation as the spring rest lengths instead of interaction radius/2.
This makes the fluid keep it's original shape better (good for very
viscoelastic materials), but can create large density differences inside
the fluid (not really physically correct for a fluid).
* Viscoelastic springs are stored in point cache as extra data.
Diffstat (limited to 'source/blender/makesdna/DNA_particle_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index cbc9e0f1c29..f140d60d3e9 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -61,6 +61,11 @@ typedef struct BoidParticle { float rt; } BoidParticle; +typedef struct ParticleSpring { + float rest_length; + unsigned int particle_index[2], delete_flag; +}ParticleSpring; + /* Child particles are created around or between parent particles */ typedef struct ChildParticle { int num, parent; /* num is face index on the final derived mesh */ @@ -116,12 +121,17 @@ typedef struct ParticleData { typedef struct SPHFluidSettings { /*Particle Fluid*/ - float spring_k, radius, rest_length; + float spring_k, radius, rest_length, plasticity_constant, yield_ratio; float viscosity_omega, viscosity_beta; float stiffness_k, stiffness_knear, rest_density; float buoyancy; + int flag, pad; } SPHFluidSettings; +/* fluid->flag */ +#define SPH_VISCOELASTIC_SPRINGS 1 +#define SPH_CURRENT_REST_LENGTH 2 + typedef struct ParticleSettings { ID id; struct AnimData *adt; @@ -254,6 +264,9 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in struct ListBase *effectors; + ParticleSpring *fluid_springs; + int tot_fluidsprings, alloc_fluidsprings; + struct KDTree *tree; /* used for interactions with self and other systems */ struct ParticleDrawData *pdd; |