diff options
| author | Crozet Sébastien <developer@crozet.re> | 2020-12-31 11:37:42 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2020-12-31 11:37:42 +0100 |
| commit | 1feac2e02d8779a1a03c9c16d5fbe4fd79c9324a (patch) | |
| tree | 4aa2cc0ce5c4c11ff5c19ef65b8c2fd9e73e1a6e /src/geometry/contact_pair.rs | |
| parent | 967145a9492175be59e8db33299b1687d69d84e2 (diff) | |
| download | rapier-1feac2e02d8779a1a03c9c16d5fbe4fd79c9324a.tar.gz rapier-1feac2e02d8779a1a03c9c16d5fbe4fd79c9324a.tar.bz2 rapier-1feac2e02d8779a1a03c9c16d5fbe4fd79c9324a.zip | |
Restore contact events.
Diffstat (limited to 'src/geometry/contact_pair.rs')
| -rw-r--r-- | src/geometry/contact_pair.rs | 15 |
1 files changed, 2 insertions, 13 deletions
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<ContactManifold>, + pub has_any_active_contact: bool, pub(crate) workspace: Option<ContactManifoldsWorkspace>, } @@ -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)] |
