diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-02-23 11:24:54 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-02-23 11:24:54 +0100 |
| commit | 00706e8b360e132cb88a7b393dcedadf35403379 (patch) | |
| tree | e2ab40056da30c614dc94fc0cb852d6207c19043 /src/geometry/contact_pair.rs | |
| parent | ad5c10672e36f47fbdb0667bccd79c59ff3a97cc (diff) | |
| download | rapier-00706e8b360e132cb88a7b393dcedadf35403379.tar.gz rapier-00706e8b360e132cb88a7b393dcedadf35403379.tar.bz2 rapier-00706e8b360e132cb88a7b393dcedadf35403379.zip | |
Introduce the PhysicsHook trait used for both contact filtering and contact modification.
Diffstat (limited to 'src/geometry/contact_pair.rs')
| -rw-r--r-- | src/geometry/contact_pair.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/geometry/contact_pair.rs b/src/geometry/contact_pair.rs index c94a2cf..11e0188 100644 --- a/src/geometry/contact_pair.rs +++ b/src/geometry/contact_pair.rs @@ -9,7 +9,10 @@ bitflags::bitflags! { pub struct SolverFlags: u32 { /// The constraint solver will take this contact manifold into /// account for force computation. - const COMPUTE_IMPULSES = 0b01; + const COMPUTE_IMPULSES = 0b001; + /// The user-defined physics hooks will be used to + /// modify the solver contacts of this contact manifold. + const MODIFY_SOLVER_CONTACTS = 0b010; } } @@ -104,6 +107,8 @@ pub struct ContactManifoldData { /// The contacts that will be seen by the constraints solver for computing forces. #[cfg_attr(feature = "serde-serialize", serde(skip))] pub solver_contacts: Vec<SolverContact>, + /// A user-defined piece of data. + pub user_data: u32, } /// A contact seen by the constraints solver for computing forces. @@ -165,6 +170,7 @@ impl ContactManifoldData { solver_flags, normal: Vector::zeros(), solver_contacts: Vec::new(), + user_data: 0, } } @@ -205,9 +211,3 @@ impl ContactManifoldData { // manifold.data.warmstart_multiplier = Self::min_warmstart_multiplier() // } } - -/// A contact manifold that can be modified by the user. -pub struct ModifiableContactManifold<'a> { - manifold: &'a super::ContactManifold, - solver_contacts: &'a mut Vec<SolverContact>, -} |
