diff options
author | Alex Fraser <alex@phatcore.com> | 2013-01-11 07:06:10 +0400 |
---|---|---|
committer | Alex Fraser <alex@phatcore.com> | 2013-01-11 07:06:10 +0400 |
commit | 17c428d4df91cab78f9f77c03e7973e0e806f045 (patch) | |
tree | de981ec10bfea6ec675326c7c2f114aabf33512e /source | |
parent | 61833ddd5a9ddb0d43e8b7d64ddfd90ea7f4b529 (diff) |
Changing units of stiffness parameter in classical (new) SPH solver: used to be speed of sound squared; now just speed of sound.
The classical SPH solver was not in 2.65, so this change is unlikely to affect many users. But beta users who have been trying it out will need to change the stiffness parameter to sqrt(old value).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 3d777e46442..5eac86a7e77 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2697,7 +2697,8 @@ static void sphclassical_force_cb(void *sphdata_v, ParticleKey *state, float *fo /* 4.77 is an experimentally determined density factor */ float rest_density = fluid->rest_density * (fluid->flag & SPH_FAC_DENSITY ? 4.77f : 1.0f); - float stiffness = fluid->stiffness_k; + // Use speed of sound squared + float stiffness = pow2(fluid->stiffness_k); ParticleData *npa; float vec[3]; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 6dc6d8809f0..4a520cdc729 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1545,9 +1545,9 @@ static void rna_def_fluid_settings(BlenderRNA *brna) /* Double density relaxation */ prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness_k"); - RNA_def_property_range(prop, 0.0f, 100000.0f); + RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); - RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is"); + RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is (speed of sound)"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop = RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE); |