diff options
| author | rezural <rezural@protonmail.com> | 2020-12-24 20:16:11 +1100 |
|---|---|---|
| committer | rezural <rezural@protonmail.com> | 2020-12-24 20:16:11 +1100 |
| commit | b1d0dc006d39faeb4a3ef85acc62f2981d26a85b (patch) | |
| tree | 593a90452b61564362dacd7bcec4b55c98b5a002 /src_testbed/harness | |
| parent | baccfff4cde4e70f79bef1d061a4bdea9a845546 (diff) | |
| download | rapier-b1d0dc006d39faeb4a3ef85acc62f2981d26a85b.tar.gz rapier-b1d0dc006d39faeb4a3ef85acc62f2981d26a85b.tar.bz2 rapier-b1d0dc006d39faeb4a3ef85acc62f2981d26a85b.zip | |
cargo fmt
Diffstat (limited to 'src_testbed/harness')
| -rw-r--r-- | src_testbed/harness/mod.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src_testbed/harness/mod.rs b/src_testbed/harness/mod.rs index dd49fe6..c6f682c 100644 --- a/src_testbed/harness/mod.rs +++ b/src_testbed/harness/mod.rs @@ -20,7 +20,7 @@ impl RunState { #[cfg(feature = "parallel")] thread_pool: rapier::rayon::ThreadPool, timestep_id: 0, - time: 0.0 + time: 0.0, } } } @@ -117,9 +117,7 @@ impl Harness { self.plugins.push(Box::new(plugin)); } - pub fn add_callback< - F: FnMut(&mut PhysicsState, &PhysicsEvents, &RunState, f32) + 'static, - >( + pub fn add_callback<F: FnMut(&mut PhysicsState, &PhysicsEvents, &RunState, f32) + 'static>( &mut self, callback: F, ) { @@ -170,11 +168,21 @@ impl Harness { } for f in &mut self.callbacks { - f(&mut self.physics, &self.events, &self.state, self.state.time) + f( + &mut self.physics, + &self.events, + &self.state, + self.state.time, + ) } for plugin in &mut self.plugins { - plugin.run_callbacks(&mut self.physics, &self.events, &self.state, self.state.time) + plugin.run_callbacks( + &mut self.physics, + &self.events, + &self.state, + self.state.time, + ) } self.events.poll_all(); |
