From fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sun, 20 Feb 2022 12:55:00 +0100 Subject: Joint API and joint motors improvements --- examples2d/joints2.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'examples2d/joints2.rs') diff --git a/examples2d/joints2.rs b/examples2d/joints2.rs index 91d86cd..7a7119e 100644 --- a/examples2d/joints2.rs +++ b/examples2d/joints2.rs @@ -35,17 +35,16 @@ pub fn init_world(testbed: &mut Testbed) { RigidBodyType::Dynamic }; - let rigid_body = RigidBodyBuilder::new(status) - .translation(vector![fk * shift, -fi * shift]) - .build(); + let rigid_body = + RigidBodyBuilder::new(status).translation(vector![fk * shift, -fi * shift]); let child_handle = bodies.insert(rigid_body); - let collider = ColliderBuilder::ball(rad).build(); + let collider = ColliderBuilder::ball(rad); colliders.insert_with_parent(collider, child_handle, &mut bodies); // Vertical joint. if i > 0 { let parent_handle = *body_handles.last().unwrap(); - let joint = RevoluteJoint::new().local_anchor2(point![0.0, shift]); + let joint = RevoluteJointBuilder::new().local_anchor2(point![0.0, shift]); impulse_joints.insert(parent_handle, child_handle, joint); } @@ -53,7 +52,7 @@ pub fn init_world(testbed: &mut Testbed) { if k > 0 { let parent_index = body_handles.len() - numi; let parent_handle = body_handles[parent_index]; - let joint = RevoluteJoint::new().local_anchor2(point![-shift, 0.0]); + let joint = RevoluteJointBuilder::new().local_anchor2(point![-shift, 0.0]); impulse_joints.insert(parent_handle, child_handle, joint); } -- cgit