diff options
| author | Sébastien Crozet <developer@crozet.re> | 2021-05-01 10:17:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-01 10:17:23 +0200 |
| commit | a385efc5582c7918f11c01a2b6bf26a46919d3a0 (patch) | |
| tree | c5b9c5e6fcb5561421e2b4b9d99f28e4c83c745e /src/geometry/contact_pair.rs | |
| parent | aaf80bfa872c6f29b248cab8eb5658ab0d73cb4a (diff) | |
| parent | 2dfbd9ae92c139e306afc87994adac82489f30eb (diff) | |
| download | rapier-a385efc5582c7918f11c01a2b6bf26a46919d3a0.tar.gz rapier-a385efc5582c7918f11c01a2b6bf26a46919d3a0.tar.bz2 rapier-a385efc5582c7918f11c01a2b6bf26a46919d3a0.zip | |
Merge pull request #183 from dimforge/bundles
Make Rapier accept any kind of data storage instead of RigidBodySet/ColliderSet
Diffstat (limited to 'src/geometry/contact_pair.rs')
| -rw-r--r-- | src/geometry/contact_pair.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/geometry/contact_pair.rs b/src/geometry/contact_pair.rs index d4e8ac4..5a568fa 100644 --- a/src/geometry/contact_pair.rs +++ b/src/geometry/contact_pair.rs @@ -1,4 +1,4 @@ -use crate::dynamics::{BodyPair, RigidBodyHandle}; +use crate::dynamics::RigidBodyHandle; use crate::geometry::{ColliderPair, Contact, ContactManifold}; use crate::math::{Point, Real, Vector}; use parry::query::ContactManifoldsWorkspace; @@ -115,8 +115,10 @@ impl ContactPair { /// part of the same contact manifold share the same contact normal and contact kinematics. pub struct ContactManifoldData { // The following are set by the narrow-phase. - /// The pair of body involved in this contact manifold. - pub body_pair: BodyPair, + /// The first rigid-body involved in this contact manifold. + pub rigid_body1: Option<RigidBodyHandle>, + /// The second rigid-body involved in this contact manifold. + pub rigid_body2: Option<RigidBodyHandle>, pub(crate) warmstart_multiplier: Real, // The two following are set by the constraints solver. #[cfg_attr(feature = "serde-serialize", serde(skip))] @@ -207,17 +209,19 @@ impl SolverContact { impl Default for ContactManifoldData { fn default() -> Self { - Self::new( - BodyPair::new(RigidBodyHandle::invalid(), RigidBodyHandle::invalid()), - SolverFlags::empty(), - ) + Self::new(None, None, SolverFlags::empty()) } } impl ContactManifoldData { - pub(crate) fn new(body_pair: BodyPair, solver_flags: SolverFlags) -> ContactManifoldData { + pub(crate) fn new( + rigid_body1: Option<RigidBodyHandle>, + rigid_body2: Option<RigidBodyHandle>, + solver_flags: SolverFlags, + ) -> ContactManifoldData { Self { - body_pair, + rigid_body1, + rigid_body2, warmstart_multiplier: Self::min_warmstart_multiplier(), constraint_index: 0, position_constraint_index: 0, |
