aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/joint/rope_joint.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2024-01-24 22:19:08 +0100
committerGitHub <noreply@github.com>2024-01-24 22:19:08 +0100
commit51f5bd6cb466fa65ee755c1905e46ff405217143 (patch)
tree67e2a9666504c87fe993ee59b76df3fb1b70760d /src/dynamics/joint/rope_joint.rs
parentaef85ec2554476485dbf3de5f01257ced22bfe2f (diff)
parentd1fc90c150ff7ddd077f5770d4ac30108b5e6de5 (diff)
downloadrapier-51f5bd6cb466fa65ee755c1905e46ff405217143.tar.gz
rapier-51f5bd6cb466fa65ee755c1905e46ff405217143.tar.bz2
rapier-51f5bd6cb466fa65ee755c1905e46ff405217143.zip
Merge pull request #581 from dimforge/solver-pick
feat: rework solver parameters to make it easy to recover the old behaviors
Diffstat (limited to 'src/dynamics/joint/rope_joint.rs')
-rw-r--r--src/dynamics/joint/rope_joint.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dynamics/joint/rope_joint.rs b/src/dynamics/joint/rope_joint.rs
index 44d4809..08c90e5 100644
--- a/src/dynamics/joint/rope_joint.rs
+++ b/src/dynamics/joint/rope_joint.rs
@@ -118,8 +118,11 @@ impl RopeJoint {
/// The maximum distance allowed between the attached objects.
#[must_use]
- pub fn max_distance(&self) -> Option<Real> {
- self.data.limits(JointAxis::X).map(|l| l.max)
+ pub fn max_distance(&self) -> Real {
+ self.data
+ .limits(JointAxis::X)
+ .map(|l| l.max)
+ .unwrap_or(Real::MAX)
}
/// Sets the maximum allowed distance between the attached objects.
@@ -146,8 +149,6 @@ pub struct RopeJointBuilder(pub RopeJoint);
impl RopeJointBuilder {
/// Creates a new builder for rope joints.
- ///
- /// This axis is expressed in the local-space of both rigid-bodies.
pub fn new(max_dist: Real) -> Self {
Self(RopeJoint::new(max_dist))
}