From 7306821c460ca3f77e697c89a79393e61c126624 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Sun, 28 Mar 2021 11:26:53 +0200 Subject: Attenuate the warmstart impulse for CCD contacts. CCD contacts result in very strong, instantaneous, impulses. So it is preferable to attenuate their contribution to subsequent timesteps to avoid overshooting. --- src_testbed/testbed.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src_testbed') diff --git a/src_testbed/testbed.rs b/src_testbed/testbed.rs index 0463da8..404912e 100644 --- a/src_testbed/testbed.rs +++ b/src_testbed/testbed.rs @@ -24,7 +24,7 @@ use rapier::dynamics::{ use rapier::geometry::{ColliderHandle, ColliderSet, NarrowPhase}; #[cfg(feature = "dim3")] use rapier::geometry::{InteractionGroups, Ray}; -use rapier::math::{Isometry, Vector}; +use rapier::math::Vector; use rapier::pipeline::PhysicsHooks; #[cfg(all(feature = "dim2", feature = "other-backends"))] @@ -1478,16 +1478,10 @@ Hashes at frame: {} } } -fn draw_contacts(window: &mut Window, nf: &NarrowPhase, colliders: &ColliderSet) { +fn draw_contacts(window: &mut Window, nf: &NarrowPhase, _colliders: &ColliderSet) { for pair in nf.contact_pairs() { for manifold in &pair.manifolds { for contact in &manifold.data.solver_contacts { - let color = if contact.dist > 0.0 { - Point3::new(0.0, 0.0, 1.0) - } else { - Point3::new(1.0, 0.0, 0.0) - }; - let p = contact.point; let n = manifold.data.normal; -- cgit