diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-04-22 16:00:52 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-04-22 17:19:19 +0300 |
commit | 07ed64aae6fde5429ffe0ab7e30d240009a98e37 (patch) | |
tree | 8adf8adf90c7221c88b83cb860165094b4e7ace5 /source/blender/blenkernel | |
parent | f148bd3795ea352642b33d11a027347abac11367 (diff) |
Fluid: Use maximum for initial velocity grid application
Using MAX2 when writing intial velocities into the grid prevents overriding initial velocities when using multiple flow objects that are close to each other.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index bde0abe1499..9709b74516b 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -3110,9 +3110,9 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, levelset, emission_in); if (mfs->flags & FLUID_FLOW_INITVELOCITY) { - velx_initial[d_index] = velocity_map[e_index * 3]; - vely_initial[d_index] = velocity_map[e_index * 3 + 1]; - velz_initial[d_index] = velocity_map[e_index * 3 + 2]; + velx_initial[d_index] = MAX2(velx_initial[d_index], velocity_map[e_index * 3]); + vely_initial[d_index] = MAX2(vely_initial[d_index], velocity_map[e_index * 3 + 1]); + velz_initial[d_index] = MAX2(velz_initial[d_index], velocity_map[e_index * 3 + 2]); } } } |