aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dynamics/joint/revolute_joint.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dynamics/joint/revolute_joint.rs b/src/dynamics/joint/revolute_joint.rs
index 4dfed5c..c7f0288 100644
--- a/src/dynamics/joint/revolute_joint.rs
+++ b/src/dynamics/joint/revolute_joint.rs
@@ -87,9 +87,9 @@ impl RevoluteJoint {
#[cfg(feature = "dim3")]
if joint_rot1.dot(&joint_rot2) < 0.0 {
- -ang_err.i.asin() * 2.0
+ -ang_err.i.clamp(-1.0, 1.0).asin() * 2.0
} else {
- ang_err.i.asin() * 2.0
+ ang_err.i.clamp(-1.0, 1.0).asin() * 2.0
}
#[cfg(feature = "dim2")]