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.
This commit is contained in:
Sebastián Barschkis 2020-04-22 15:00:52 +02:00
parent f148bd3795
commit 07ed64aae6
1 changed files with 3 additions and 3 deletions

View File

@ -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]);
}
}
}