Add the option to automatically wake-up rigid-bodies a new joint is attached to
This commit is contained in:
@@ -37,7 +37,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
if i > 0 {
|
||||
let parent_handle = *body_handles.last().unwrap();
|
||||
let joint = SphericalJointBuilder::new().local_anchor2(point![0.0, 0.0, -shift]);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint, true);
|
||||
}
|
||||
|
||||
// Horizontal joint.
|
||||
@@ -45,7 +45,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let parent_index = body_handles.len() - num;
|
||||
let parent_handle = body_handles[parent_index];
|
||||
let joint = SphericalJointBuilder::new().local_anchor2(point![-shift, 0.0, 0.0]);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint, true);
|
||||
}
|
||||
|
||||
body_handles.push(child_handle);
|
||||
|
||||
@@ -54,7 +54,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let parent_handle = *body_handles.last().unwrap();
|
||||
let joint =
|
||||
FixedJointBuilder::new().local_anchor2(point![0.0, 0.0, -shift]);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint, true);
|
||||
}
|
||||
|
||||
// Horizontal joint.
|
||||
@@ -63,7 +63,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let parent_handle = body_handles[parent_index];
|
||||
let joint =
|
||||
FixedJointBuilder::new().local_anchor2(point![-shift, 0.0, 0.0]);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint);
|
||||
impulse_joints.insert(parent_handle, child_handle, joint, true);
|
||||
}
|
||||
|
||||
body_handles.push(child_handle);
|
||||
|
||||
@@ -45,7 +45,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let prism = PrismaticJointBuilder::new(axis)
|
||||
.local_anchor2(point![0.0, 0.0, -shift])
|
||||
.limits([-2.0, 0.0]);
|
||||
impulse_joints.insert(curr_parent, curr_child, prism);
|
||||
impulse_joints.insert(curr_parent, curr_child, prism, true);
|
||||
|
||||
curr_parent = curr_child;
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
RevoluteJointBuilder::new(x).local_anchor2(point![shift, 0.0, 0.0]),
|
||||
];
|
||||
|
||||
impulse_joints.insert(curr_parent, handles[0], revs[0]);
|
||||
impulse_joints.insert(handles[0], handles[1], revs[1]);
|
||||
impulse_joints.insert(handles[1], handles[2], revs[2]);
|
||||
impulse_joints.insert(handles[2], handles[3], revs[3]);
|
||||
impulse_joints.insert(curr_parent, handles[0], revs[0], true);
|
||||
impulse_joints.insert(handles[0], handles[1], revs[1], true);
|
||||
impulse_joints.insert(handles[1], handles[2], revs[2], true);
|
||||
impulse_joints.insert(handles[2], handles[3], revs[3], true);
|
||||
|
||||
curr_parent = handles[3];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user