diff options
| author | rezural <rezural@protonmail.com> | 2020-12-21 14:56:05 +1100 |
|---|---|---|
| committer | rezural <rezural@protonmail.com> | 2020-12-21 14:56:05 +1100 |
| commit | 496f4e32588d4f5efd821e7834ddd0d7b0dd1acc (patch) | |
| tree | a2017a39480dcd9045da00dbf0ff9c60d6b16259 /src_testbed/harness/mod.rs | |
| parent | 16720918aac974a57f82c5bc0e840b36c8fa5970 (diff) | |
| download | rapier-496f4e32588d4f5efd821e7834ddd0d7b0dd1acc.tar.gz rapier-496f4e32588d4f5efd821e7834ddd0d7b0dd1acc.tar.bz2 rapier-496f4e32588d4f5efd821e7834ddd0d7b0dd1acc.zip | |
remove some commented code
Diffstat (limited to 'src_testbed/harness/mod.rs')
| -rw-r--r-- | src_testbed/harness/mod.rs | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/src_testbed/harness/mod.rs b/src_testbed/harness/mod.rs index 8ea141f..fa6c4c6 100644 --- a/src_testbed/harness/mod.rs +++ b/src_testbed/harness/mod.rs @@ -1,4 +1,5 @@ use crate::physics::{PhysicsEvents, PhysicsState}; +use plugin::HarnessPlugin; use rapier::dynamics::{IntegrationParameters, JointSet, RigidBodySet}; use rapier::geometry::{BroadPhase, ColliderSet, NarrowPhase}; use rapier::math::Vector; @@ -6,22 +7,10 @@ use rapier::pipeline::{ChannelEventCollector, PhysicsPipeline, QueryPipeline}; pub mod plugin; -use plugin::HarnessPlugin; - -// #[derive(PartialEq)] -// pub enum RunState { -// Initialized, -// Running, -// Pausing, -// Paused, -// Finished, -// } - pub struct HarnessState { #[cfg(feature = "parallel")] pub thread_pool: rapier::rayon::ThreadPool, pub timestep_id: usize, - // pub run_state: RunState, } pub struct Harness { @@ -49,9 +38,6 @@ impl Harness { .build() .unwrap(); - // #[cfg(feature = "parallel")] - // println!("Rapier Harness Parallel, num_threads: {}", num_threads); - let contact_channel = crossbeam::channel::unbounded(); let proximity_channel = crossbeam::channel::unbounded(); let event_handler = ChannelEventCollector::new(proximity_channel.0, contact_channel.0); @@ -64,7 +50,6 @@ impl Harness { #[cfg(feature = "parallel")] thread_pool, timestep_id: 0, - // run_state: RunState::Initialized }; Self { @@ -85,12 +70,6 @@ impl Harness { res } - // pub fn pause_at_next_step(&mut self) { - // if self.state.run_state == RunState::Running { - // self.state.run_state = RunState::Pausing - // } - // } - pub fn set_max_steps(&mut self, max_steps: usize) { self.max_steps = max_steps } @@ -123,28 +102,16 @@ impl Harness { self.physics.broad_phase = BroadPhase::new(); self.physics.narrow_phase = NarrowPhase::new(); self.time = 0.0; - // self.state.timestep_id = 0; - // self.state.highlighted_body = None; + self.state.timestep_id = 0; self.physics.query_pipeline = QueryPipeline::new(); self.physics.pipeline = PhysicsPipeline::new(); self.physics.pipeline.counters.enable(); } - // fn clear(&mut self) { - // self.callbacks.clear(); - // - // for plugin in &mut self.plugins { - // plugin.clear_graphics(window); - // } - // - // self.plugins.clear(); - // } - pub fn add_plugin(&mut self, plugin: impl HarnessPlugin + 'static) { self.plugins.push(Box::new(plugin)); } - // type StepCallback = FnMut(&mut PhysicsState, &PhysicsEvents, f32); pub fn add_callback< F: FnMut(&mut PhysicsState, &PhysicsEvents, &HarnessState, f32) + 'static, >( |
