aboutsummaryrefslogtreecommitdiff
path: root/src_testbed/testbed.rs
diff options
context:
space:
mode:
authorrezural <rezural@protonmail.com>2020-12-31 12:14:38 +1100
committerrezural <rezural@protonmail.com>2020-12-31 12:14:38 +1100
commitd51008903dc77be6bf7ed1eebcf592f587b3f448 (patch)
treeaa5856891ae500a6f31098a139132f73086cf8b7 /src_testbed/testbed.rs
parent47e0ad44257d386e3647564c5b2120042c207992 (diff)
downloadrapier-d51008903dc77be6bf7ed1eebcf592f587b3f448.tar.gz
rapier-d51008903dc77be6bf7ed1eebcf592f587b3f448.tar.bz2
rapier-d51008903dc77be6bf7ed1eebcf592f587b3f448.zip
remove plugin callback related code from testbed
Diffstat (limited to 'src_testbed/testbed.rs')
-rw-r--r--src_testbed/testbed.rs26
1 files changed, 1 insertions, 25 deletions
diff --git a/src_testbed/testbed.rs b/src_testbed/testbed.rs
index c169a85..db9f32d 100644
--- a/src_testbed/testbed.rs
+++ b/src_testbed/testbed.rs
@@ -123,7 +123,6 @@ pub struct Testbed {
graphics: GraphicsManager,
nsteps: usize,
camera_locked: bool, // Used so that the camera can remain the same before and after we change backend or press the restart button.
- callbacks: Callbacks,
plugins: Vec<Box<dyn TestbedPlugin>>,
hide_counters: bool,
// persistant_contacts: HashMap<ContactId, bool>,
@@ -140,10 +139,6 @@ pub struct Testbed {
nphysics: Option<NPhysicsWorld>,
}
-type Callbacks = Vec<
- Box<dyn FnMut(&mut Window, &mut PhysicsState, &PhysicsEvents, &mut GraphicsManager, &RunState)>,
->;
-
impl Testbed {
pub fn new_empty() -> Testbed {
let graphics = GraphicsManager::new();
@@ -185,7 +180,6 @@ impl Testbed {
Testbed {
builders: Vec::new(),
- callbacks: Vec::new(),
plugins: Vec::new(),
graphics,
nsteps: 1,
@@ -382,8 +376,6 @@ impl Testbed {
}
fn clear(&mut self, window: &mut Window) {
- //FIXME: do we need to do this still, after moving to harness code?
- self.callbacks.clear();
// self.persistant_contacts.clear();
// self.state.grabbed_object = None;
// self.state.grabbed_object_constraint = None;
@@ -401,16 +393,6 @@ impl Testbed {
self.plugins.push(Box::new(plugin));
}
- pub fn add_callback<
- F: FnMut(&mut Window, &mut PhysicsState, &PhysicsEvents, &mut GraphicsManager, &RunState)
- + 'static,
- >(
- &mut self,
- callback: F,
- ) {
- self.callbacks.push(Box::new(callback));
- }
-
pub fn run(mut self) {
let mut args = env::args();
let mut benchmark_mode = false;
@@ -1029,8 +1011,6 @@ impl State for Testbed {
);
}
- // let physics = &self.harness.physics;
-
// Handle UI actions.
{
let backend_changed = self
@@ -1291,11 +1271,7 @@ impl State for Testbed {
}
for plugin in &mut self.plugins {
- plugin.run_callbacks(
- window,
- &mut self.harness.physics,
- &self.harness.state,
- );
+ plugin.run_callbacks(window, &mut self.harness.physics, &self.harness.state);
}
// if true {