Add the option to automatically wake-up rigid-bodies a new joint is attached to

This commit is contained in:
Sébastien Crozet
2022-05-30 18:24:46 +02:00
parent 6ce26f3818
commit ab8833f275
16 changed files with 138 additions and 111 deletions

View File

@@ -42,7 +42,7 @@ pub fn init_world(testbed: &mut Testbed) {
if i > 0 {
let parent_handle = *body_handles.last().unwrap();
let joint = RevoluteJointBuilder::new().local_anchor2(point![0.0, shift]);
impulse_joints.insert(parent_handle, child_handle, joint);
impulse_joints.insert(parent_handle, child_handle, joint, true);
}
// Horizontal joint.
@@ -50,7 +50,7 @@ pub fn init_world(testbed: &mut Testbed) {
let parent_index = body_handles.len() - numi;
let parent_handle = body_handles[parent_index];
let joint = RevoluteJointBuilder::new().local_anchor2(point![-shift, 0.0]);
impulse_joints.insert(parent_handle, child_handle, joint);
impulse_joints.insert(parent_handle, child_handle, joint, true);
}
body_handles.push(child_handle);

View File

@@ -48,7 +48,7 @@ pub fn init_world(testbed: &mut Testbed) {
let parent_handle = *body_handles.last().unwrap();
let joint = FixedJointBuilder::new()
.local_frame2(Isometry::translation(0.0, shift));
impulse_joints.insert(parent_handle, child_handle, joint);
impulse_joints.insert(parent_handle, child_handle, joint, true);
}
// Horizontal joint.
@@ -57,7 +57,7 @@ pub fn init_world(testbed: &mut Testbed) {
let parent_handle = body_handles[parent_index];
let joint = FixedJointBuilder::new()
.local_frame2(Isometry::translation(-shift, 0.0));
impulse_joints.insert(parent_handle, child_handle, joint);
impulse_joints.insert(parent_handle, child_handle, joint, true);
}
body_handles.push(child_handle);

View File

@@ -46,7 +46,7 @@ pub fn init_world(testbed: &mut Testbed) {
let prism = PrismaticJointBuilder::new(axis)
.local_anchor2(point![0.0, shift])
.limits([-1.5, 1.5]);
impulse_joints.insert(curr_parent, curr_child, prism);
impulse_joints.insert(curr_parent, curr_child, prism, true);
curr_parent = curr_child;
}