From 1feac2e02d8779a1a03c9c16d5fbe4fd79c9324a Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Thu, 31 Dec 2020 11:37:42 +0100 Subject: Restore contact events. --- src/geometry/contact_pair.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/geometry/contact_pair.rs') diff --git a/src/geometry/contact_pair.rs b/src/geometry/contact_pair.rs index 3ad4f70..b2ae812 100644 --- a/src/geometry/contact_pair.rs +++ b/src/geometry/contact_pair.rs @@ -62,6 +62,7 @@ pub struct ContactPair { /// /// All contact manifold contain themselves contact points between the colliders. pub manifolds: Vec, + pub has_any_active_contact: bool, pub(crate) workspace: Option, } @@ -69,23 +70,11 @@ impl ContactPair { pub(crate) fn new(pair: ColliderPair) -> Self { Self { pair, + has_any_active_contact: false, manifolds: Vec::new(), workspace: None, } } - - /// Does this contact pair have any active contact? - /// - /// An active contact is a contact that may result in a non-zero contact force. - pub fn has_any_active_contact(&self) -> bool { - for manifold in &self.manifolds { - if manifold.data.num_active_contacts() != 0 { - return true; - } - } - - false - } } #[derive(Clone, Debug)] -- cgit