From c32da78f2a6014c491aa3e975fb83ddb7c80610e Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 26 Apr 2021 17:59:25 +0200 Subject: Split rigid-bodies and colliders into multiple components --- src/geometry/contact_pair.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/geometry/contact_pair.rs') 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, + /// The second rigid-body involved in this contact manifold. + pub rigid_body2: Option, 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, + rigid_body2: Option, + solver_flags: SolverFlags, + ) -> ContactManifoldData { Self { - body_pair, + rigid_body1, + rigid_body2, warmstart_multiplier: Self::min_warmstart_multiplier(), constraint_index: 0, position_constraint_index: 0, -- cgit