diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-02-20 12:55:00 +0100 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2022-03-20 21:49:16 +0100 |
| commit | fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4 (patch) | |
| tree | 45827ac4c754c3670d1ddb2f91fc498515d6b3b8 /benchmarks3d/joint_fixed3.rs | |
| parent | e740493b980dc9856864ead3206a4fa02aff965f (diff) | |
| download | rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.tar.gz rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.tar.bz2 rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.zip | |
Joint API and joint motors improvements
Diffstat (limited to 'benchmarks3d/joint_fixed3.rs')
| -rw-r--r-- | benchmarks3d/joint_fixed3.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/benchmarks3d/joint_fixed3.rs b/benchmarks3d/joint_fixed3.rs index b3f4039..5fdba9c 100644 --- a/benchmarks3d/joint_fixed3.rs +++ b/benchmarks3d/joint_fixed3.rs @@ -40,17 +40,20 @@ pub fn init_world(testbed: &mut Testbed) { RigidBodyType::Dynamic }; - let rigid_body = RigidBodyBuilder::new(status) - .translation(vector![x + fk * shift, y, z + fi * shift]) - .build(); + let rigid_body = RigidBodyBuilder::new(status).translation(vector![ + x + fk * shift, + y, + z + 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 = FixedJoint::new().local_anchor2(point![0.0, 0.0, -shift]); + let joint = + FixedJointBuilder::new().local_anchor2(point![0.0, 0.0, -shift]); impulse_joints.insert(parent_handle, child_handle, joint); } @@ -58,7 +61,8 @@ pub fn init_world(testbed: &mut Testbed) { if k > 0 { let parent_index = body_handles.len() - num; let parent_handle = body_handles[parent_index]; - let joint = FixedJoint::new().local_anchor2(point![-shift, 0.0, 0.0]); + let joint = + FixedJointBuilder::new().local_anchor2(point![-shift, 0.0, 0.0]); impulse_joints.insert(parent_handle, child_handle, joint); } |
