Skip to content

Commit

Permalink
Enable collisions when life is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterchef365 committed Mar 13, 2024
1 parent af67ce5 commit ca2be03
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
56 changes: 35 additions & 21 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,29 +494,44 @@ impl TemplateApp {
let mut do_reset = false;

ui.strong("Particle behaviour");
let mut changed = false;
Grid::new("particle mode settings").show(ui, |ui| {
ui.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::Off,
"Off (kinematics only)",
);
ui.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::NodeGraph,
"Node graph",
);
changed |= ui
.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::Off,
"Off (kinematics only)",
)
.changed();
changed |= ui
.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::NodeGraph,
"Node graph",
)
.changed();
ui.end_row();
ui.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::ParticleLife,
"Particle life",
);
ui.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::Both,
"Both (graph + life)",
);

changed |= ui
.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::ParticleLife,
"Particle life",
)
.changed();

changed |= ui
.radio_value(
&mut self.save.working.tweak.particle_mode,
ParticleBehaviourMode::Both,
"Both (graph + life)",
)
.changed();
});
if changed {
self.save.working.tweak.enable_particle_collisions =
!self.save.working.tweak.particle_mode.uses_life();
}

ui.separator();
ui.strong("Save data");
Expand Down Expand Up @@ -841,7 +856,6 @@ impl TemplateApp {
ui.checkbox(&mut self.save.working.well, "Enable");
});


if self.save.working.tweak.enable_grid_transfer {
ui.separator();
ui.strong("Incompressibility Solver");
Expand Down
2 changes: 1 addition & 1 deletion src/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ fn per_neighbor_node_interactions(
impl Default for SimTweak {
fn default() -> Self {
Self {
enable_particle_collisions: false,
enable_particle_collisions: true,
enable_incompress: true,
enable_grid_transfer: true,
pic_apic_ratio: 1.,
Expand Down

0 comments on commit ca2be03

Please sign in to comment.