aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/rigid_body.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dynamics/rigid_body.rs')
-rw-r--r--src/dynamics/rigid_body.rs24
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.