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:
parent
8d5ae15040
commit
a0fe22095e
Notes:
blender-bot
2023-02-13 11:56:13 +01:00
Referenced by commit 6524aaf685
, Fix T76008: Fluid inflow with negative initial velocity is not working
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue