Skip to content

Commit

Permalink
Add a complicated thing for a small detail that irked me
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterchef365 committed Mar 5, 2024
1 parent 6f1af3a commit 4e67cb5
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct TemplateApp {
width: usize,
height: usize,
set_inter_dist_to_radius: bool,
set_hard_collisions_based_on_particle_life: bool,
//show_arrows: bool,
//show_grid: bool,
//grid_vel_scale: f32,
Expand Down Expand Up @@ -73,6 +74,7 @@ impl TemplateApp {

Self {
n_particles,
set_hard_collisions_based_on_particle_life: true,
life,
tweak,
node_cfg,
Expand Down Expand Up @@ -327,11 +329,24 @@ impl TemplateApp {
.speed(1e-2)
.clamp_range(1e-2..=5.0),
);

if self.set_hard_collisions_based_on_particle_life {
self.tweak.enable_particle_collisions = self.tweak.particle_mode != ParticleBehaviourMode::ParticleLife;
}
if self.advanced {
ui.checkbox(
&mut self.tweak.enable_particle_collisions,
"Hard collisions",
);
ui.horizontal(|ui| {
ui.checkbox(
&mut self.tweak.enable_particle_collisions,
"Hard collisions",
);

ui.label("(");
ui.checkbox(
&mut self.set_hard_collisions_based_on_particle_life,
"if particle life not actv.",
);
ui.label(")");
});
ui.horizontal(|ui| {
let mut rest_density = self.tweak.rest_density();
if ui
Expand Down

0 comments on commit 4e67cb5

Please sign in to comment.