more cleanup

main
Zynh0722 2024-02-17 01:51:56 -08:00
parent 9d5ced0539
commit be7c6763f0
1 changed files with 4 additions and 13 deletions

View File

@ -55,28 +55,21 @@ fn model(app: &App) -> Model {
let mut engine = PhysicsEngine { let mut engine = PhysicsEngine {
state: PhysicsState { state: PhysicsState {
gravity: vector![0.0, -9.81 * 10.0], gravity: vector![0., -9.81 * 10.],
..Default::default() ..Default::default()
}, },
..Default::default() ..Default::default()
}; };
/* Create the ground. */ /* Create the ground. */
let collider = ColliderBuilder::cuboid(100.0, 10.0) let collider = ColliderBuilder::cuboid(100., 10.)
.translation(vector![0.0, -200.0]) .translation(vector![0., -200.])
.build(); .build();
engine.state.colliders.insert(collider); engine.state.colliders.insert(collider);
// let mut particles = Vec::new();
// fill_particles(app, &mut particles);
fill_particles(app, &mut engine.state.colliders, &mut engine.state.bodies); fill_particles(app, &mut engine.state.colliders, &mut engine.state.bodies);
Model { Model { _window, engine }
_window,
// particles,
engine,
}
} }
// Handle events related to the window and update the model if necessary // Handle events related to the window and update the model if necessary
@ -111,8 +104,6 @@ fn event(app: &App, model: &mut Model, event: WindowEvent) {
&mut model.engine.state.bodies, &mut model.engine.state.bodies,
); );
} }
// println!("{:?}", event);
} }
// Update the state of your application here. By default, this gets called right before `view`. // Update the state of your application here. By default, this gets called right before `view`.