aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2024-01-24 23:26:42 +0100
committerGitHub <noreply@github.com>2024-01-24 23:26:42 +0100
commit6cee6b01f2e5487d1109a1ce9a7250252426aa8a (patch)
tree77f6e0b2f5a22015ad9fbf9f6d3e80cb38ab3814 /src
parent7ba53df734128c45d3440366169d5f10bfa87183 (diff)
parent9fed726aa9c221fe1591784d1ea57c3f8d80ced6 (diff)
downloadrapier-6cee6b01f2e5487d1109a1ce9a7250252426aa8a.tar.gz
rapier-6cee6b01f2e5487d1109a1ce9a7250252426aa8a.tar.bz2
rapier-6cee6b01f2e5487d1109a1ce9a7250252426aa8a.zip
Merge pull request #571 from AnonymousAcid7787/fix-Setting-the-motor-position-of-a-Spherical-multibody-joint-is-broken
Fix #416 Update spherical joint motor position
Diffstat (limited to 'src')
-rw-r--r--src/dynamics/joint/multibody_joint/multibody_joint.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dynamics/joint/multibody_joint/multibody_joint.rs b/src/dynamics/joint/multibody_joint/multibody_joint.rs
index 62fc434..11ea890 100644
--- a/src/dynamics/joint/multibody_joint/multibody_joint.rs
+++ b/src/dynamics/joint/multibody_joint/multibody_joint.rs
@@ -115,6 +115,9 @@ impl MultibodyJoint {
let angvel = Vector3::from_row_slice(&vels[curr_free_dof..curr_free_dof + 3]);
let disp = UnitQuaternion::new_eps(angvel * dt, 0.0);
self.joint_rot = disp * self.joint_rot;
+ self.coords[3] += angvel[0] * dt;
+ self.coords[4] += angvel[1] * dt;
+ self.coords[5] += angvel[2] * dt;
}
_ => unreachable!(),
}