diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-01-24 11:13:44 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-01-24 11:13:44 +0100 |
| commit | 8f7220f03d3c23574b9ece09d81d32e862f1b5c6 (patch) | |
| tree | 643baa2128965fbbaab3f13c67644eba90b8135c /src/dynamics/rigid_body.rs | |
| parent | 90db26eb501b65cda362dcef34777106f533248b (diff) | |
| download | rapier-8f7220f03d3c23574b9ece09d81d32e862f1b5c6.tar.gz rapier-8f7220f03d3c23574b9ece09d81d32e862f1b5c6.tar.bz2 rapier-8f7220f03d3c23574b9ece09d81d32e862f1b5c6.zip | |
Rename cdl to parry.
Diffstat (limited to 'src/dynamics/rigid_body.rs')
| -rw-r--r-- | src/dynamics/rigid_body.rs | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index 85fdec9..5fb6183 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -678,11 +678,9 @@ impl RigidBodyBuilder { } /// Prevents this rigid-body from translating because of forces. - /// - /// This is equivalent to `self.mass(0.0, false)`. See the - /// documentation of [`RigidBodyBuilder::mass`] for more details. - pub fn lock_translations(self) -> Self { - self.mass(0.0, false) + pub fn lock_translations(mut self) -> Self { + self.flags.set(RigidBodyFlags::TRANSLATION_LOCKED, true); + self } /// Prevents this rigid-body from rotating because of forces. @@ -711,22 +709,8 @@ impl RigidBodyBuilder { } /// Sets the mass of the rigid-body being built. - /// - /// In order to lock the translations of this rigid-body (by - /// making them kinematic), call `.mass(0.0, false)`. - /// - /// If `colliders_contribution_enabled` is `false`, then the mass specified here - /// will be the final mass of the rigid-body created by this builder. - /// If `colliders_contribution_enabled` is `true`, then the final mass of the rigid-body - /// will depends on the initial mass set by this method to which is added - /// the contributions of all the colliders with non-zero density attached to - /// this rigid-body. - pub fn mass(mut self, mass: Real, colliders_contribution_enabled: bool) -> Self { + pub fn mass(mut self, mass: Real) -> Self { self.mass_properties.inv_mass = utils::inv(mass); - self.flags.set( - RigidBodyFlags::TRANSLATION_LOCKED, - !colliders_contribution_enabled, - ); self } /// Sets the angular inertia of this rigid-body. |
