Skip to content

Commit

Permalink
Make it more fun to play with
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterchef365 committed Jun 9, 2024
1 parent b027158 commit 30c3b4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ impl eframe::App for DemoApp {

let mut dims = self.sim.dims();
let mut width = self.sim.width();
let resp_dims = ui.add(DragValue::new(&mut dims).prefix("dims: "));
let resp_width = ui.add(DragValue::new(&mut width).prefix("width: "));
let resp_dims = ui.add(DragValue::new(&mut dims).prefix("dims: ").clamp_range(1..=24));
let resp_width = ui.add(DragValue::new(&mut width).prefix("width: ").clamp_range(2..=100));
let regen = ui.button("Refresh").clicked();

if resp_dims.changed() || resp_width.changed() {
if resp_dims.changed() || resp_width.changed() || regen {
*self = Self::from_dims(dims, width);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn generate_axes(dims: usize) -> Vec<Vec3> {
if dims <= 3 {
[Vec3::X, Vec3::Y, Vec3::Z][..dims].to_vec()
} else {
(0..dims).map(|_| gen_rand_vect(&mut rng, dims) * dims as f32).collect()
(0..dims).map(|_| gen_rand_vect(&mut rng, dims)).collect()
}
}

Expand Down

0 comments on commit 30c3b4c

Please sign in to comment.