aboutsummaryrefslogtreecommitdiff
path: root/src_testbed/testbed.rs
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2021-03-30 17:08:51 +0200
committerCrozet Sébastien <developer@crozet.re>2021-03-30 17:10:50 +0200
commitd2ee6420538d7ee524f2096995d4f44fcfef4551 (patch)
treea2aa5564fb16830cc224f451f6c56be19d191cf5 /src_testbed/testbed.rs
parentc3a0c67272e09d3bb4f80aca145ff580d0172745 (diff)
downloadrapier-d2ee6420538d7ee524f2096995d4f44fcfef4551.tar.gz
rapier-d2ee6420538d7ee524f2096995d4f44fcfef4551.tar.bz2
rapier-d2ee6420538d7ee524f2096995d4f44fcfef4551.zip
CCD: take angular motion and penetration depth into account in various thresholds.
Diffstat (limited to 'src_testbed/testbed.rs')
-rw-r--r--src_testbed/testbed.rs26
1 files changed, 5 insertions, 21 deletions
diff --git a/src_testbed/testbed.rs b/src_testbed/testbed.rs
index 404912e..d8ac9e3 100644
--- a/src_testbed/testbed.rs
+++ b/src_testbed/testbed.rs
@@ -125,7 +125,6 @@ pub struct Testbed {
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.
plugins: Vec<Box<dyn TestbedPlugin>>,
- hide_counters: bool,
// persistant_contacts: HashMap<ContactId, bool>,
font: Rc<Font>,
cursor_pos: Point2<f32>,
@@ -185,7 +184,6 @@ impl Testbed {
graphics,
nsteps: 1,
camera_locked: false,
- hide_counters: true,
// persistant_contacts: HashMap::new(),
font: Font::default(),
cursor_pos: Point2::new(0.0f32, 0.0),
@@ -225,14 +223,6 @@ impl Testbed {
self.state.can_grab_behind_ground = allow;
}
- pub fn hide_performance_counters(&mut self) {
- self.hide_counters = true;
- }
-
- pub fn show_performance_counters(&mut self) {
- self.hide_counters = false;
- }
-
pub fn integration_parameters_mut(&mut self) -> &mut IntegrationParameters {
&mut self.harness.physics.integration_parameters
}
@@ -1342,14 +1332,6 @@ impl State for Testbed {
for plugin in &mut self.plugins {
plugin.run_callbacks(window, &mut self.harness.physics, &self.harness.state);
}
-
- // if true {
- // // !self.hide_counters {
- // #[cfg(not(feature = "log"))]
- // println!("{}", self.world.counters);
- // #[cfg(feature = "log")]
- // debug!("{}", self.world.counters);
- // }
}
}
@@ -1478,9 +1460,12 @@ Hashes at frame: {}
}
}
-fn draw_contacts(window: &mut Window, nf: &NarrowPhase, _colliders: &ColliderSet) {
+fn draw_contacts(window: &mut Window, nf: &NarrowPhase, colliders: &ColliderSet) {
+ use rapier::math::Isometry;
+
for pair in nf.contact_pairs() {
for manifold in &pair.manifolds {
+ /*
for contact in &manifold.data.solver_contacts {
let p = contact.point;
let n = manifold.data.normal;
@@ -1488,7 +1473,7 @@ fn draw_contacts(window: &mut Window, nf: &NarrowPhase, _colliders: &ColliderSet
use crate::engine::GraphicsWindow;
window.draw_graphics_line(&p, &(p + n * 0.4), &Point3::new(0.5, 1.0, 0.5));
}
- /*
+ */
for pt in manifold.contacts() {
let color = if pt.dist > 0.0 {
Point3::new(0.0, 0.0, 1.0)
@@ -1509,7 +1494,6 @@ fn draw_contacts(window: &mut Window, nf: &NarrowPhase, _colliders: &ColliderSet
window.draw_graphics_line(&start, &(start + n * 0.4), &Point3::new(0.5, 1.0, 0.5));
window.draw_graphics_line(&start, &end, &color);
}
- */
}
}
}