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:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user