diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-02-23 16:02:19 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-02-23 16:02:19 +0100 |
| commit | 0f0f2c344fd78c3d1ca9ec07d3523c5d0ea10c82 (patch) | |
| tree | 39c9ece3366ee3b7f82342c60e53521c291c7206 | |
| parent | babcab0bed23fadd23181ccc58aae34fb80d01d8 (diff) | |
| download | rapier-0f0f2c344fd78c3d1ca9ec07d3523c5d0ea10c82.tar.gz rapier-0f0f2c344fd78c3d1ca9ec07d3523c5d0ea10c82.tar.bz2 rapier-0f0f2c344fd78c3d1ca9ec07d3523c5d0ea10c82.zip | |
Rename modify_contacts -> modify_solver_contacts.
| -rw-r--r-- | examples2d/one_way_platforms2.rs | 4 | ||||
| -rw-r--r-- | examples3d/one_way_platforms3.rs | 4 | ||||
| -rw-r--r-- | src/geometry/collider.rs | 13 | ||||
| -rw-r--r-- | src/pipeline/physics_hooks.rs | 2 |
4 files changed, 13 insertions, 10 deletions
diff --git a/examples2d/one_way_platforms2.rs b/examples2d/one_way_platforms2.rs index c7f58e8..2e1788e 100644 --- a/examples2d/one_way_platforms2.rs +++ b/examples2d/one_way_platforms2.rs @@ -77,12 +77,12 @@ pub fn init_world(testbed: &mut Testbed) { let collider = ColliderBuilder::cuboid(25.0, 0.5) .translation(30.0, 2.0) - .modify_contacts(true) + .modify_solver_contacts(true) .build(); let platform1 = colliders.insert(collider, handle, &mut bodies); let collider = ColliderBuilder::cuboid(25.0, 0.5) .translation(-30.0, -2.0) - .modify_contacts(true) + .modify_solver_contacts(true) .build(); let platform2 = colliders.insert(collider, handle, &mut bodies); diff --git a/examples3d/one_way_platforms3.rs b/examples3d/one_way_platforms3.rs index b3182a4..ea70e69 100644 --- a/examples3d/one_way_platforms3.rs +++ b/examples3d/one_way_platforms3.rs @@ -77,12 +77,12 @@ pub fn init_world(testbed: &mut Testbed) { let collider = ColliderBuilder::cuboid(9.0, 0.5, 25.0) .translation(0.0, 2.0, 30.0) - .modify_contacts(true) + .modify_solver_contacts(true) .build(); let platform1 = colliders.insert(collider, handle, &mut bodies); let collider = ColliderBuilder::cuboid(9.0, 0.5, 25.0) .translation(0.0, -2.0, -30.0) - .modify_contacts(true) + .modify_solver_contacts(true) .build(); let platform2 = colliders.insert(collider, handle, &mut bodies); diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index 4be6d29..b006f9e 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -162,7 +162,7 @@ pub struct ColliderBuilder { pub is_sensor: bool, /// Do we have to always call the contact modifier /// on this collider? - pub modify_contacts: bool, + pub modify_solver_contacts: bool, /// The user-data of the collider being built. pub user_data: u128, /// The collision groups for the collider being built. @@ -186,7 +186,7 @@ impl ColliderBuilder { solver_groups: InteractionGroups::all(), friction_combine_rule: CoefficientCombineRule::Average, restitution_combine_rule: CoefficientCombineRule::Average, - modify_contacts: false, + modify_solver_contacts: false, } } @@ -463,8 +463,8 @@ impl ColliderBuilder { /// If set to `true` then the physics hooks will always run to modify /// contacts involving this collider. - pub fn modify_contacts(mut self, modify_contacts: bool) -> Self { - self.modify_contacts = modify_contacts; + pub fn modify_solver_contacts(mut self, modify_solver_contacts: bool) -> Self { + self.modify_solver_contacts = modify_solver_contacts; self } @@ -547,7 +547,10 @@ impl ColliderBuilder { .with_friction_combine_rule(self.friction_combine_rule) .with_restitution_combine_rule(self.restitution_combine_rule); let mut solver_flags = SolverFlags::default(); - solver_flags.set(SolverFlags::MODIFY_SOLVER_CONTACTS, self.modify_contacts); + solver_flags.set( + SolverFlags::MODIFY_SOLVER_CONTACTS, + self.modify_solver_contacts, + ); Collider { shape: self.shape.clone(), diff --git a/src/pipeline/physics_hooks.rs b/src/pipeline/physics_hooks.rs index d7b7b7e..11ca485 100644 --- a/src/pipeline/physics_hooks.rs +++ b/src/pipeline/physics_hooks.rs @@ -179,7 +179,7 @@ pub trait PhysicsHooks: Send + Sync { /// contains the `PhysicsHooksFlags::MODIFY_SOLVER_CONTACTS` flags. /// /// By default, the content of `solver_contacts` is computed from `manifold.points`. - /// This method will be called on each contact manifold which have the flag `SolverFlags::MODIFY_CONTACTS` set. + /// This method will be called on each contact manifold which have the flag `SolverFlags::modify_solver_contacts` set. /// This method can be used to modify the set of solver contacts seen by the constraints solver: contacts /// can be removed and modified. /// |
