Skip to content

Commit

Permalink
Fix #416 - update ball joint motor pos
Browse files Browse the repository at this point in the history
  • Loading branch information
nsjvidana committed Dec 27, 2023
1 parent e962839 commit 26459f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples3d/spherical_joint_testing.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use rapier3d::prelude::*;
use rapier_testbed3d::{Testbed, TestbedApp};
use rapier_testbed3d::Testbed;

pub fn init_world(testbed: &mut Testbed) {

let mut bodies = RigidBodySet::new();
let mut colliders = ColliderSet::new();
let impulse_joints = ImpulseJointSet::new();
let mut impulse_joints = ImpulseJointSet::new();
let mut multibody_joints = MultibodyJointSet::new();


Expand Down
3 changes: 3 additions & 0 deletions src/dynamics/joint/multibody_joint/multibody_joint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
}
Expand Down

0 comments on commit 26459f3

Please sign in to comment.