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 /examples2d/drum2.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 'examples2d/drum2.rs')
| -rw-r--r-- | examples2d/drum2.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/examples2d/drum2.rs b/examples2d/drum2.rs index 9bc8a37..57c891f 100644 --- a/examples2d/drum2.rs +++ b/examples2d/drum2.rs @@ -26,11 +26,9 @@ pub fn init_world(testbed: &mut Testbed) { let y = j as f32 * shift - centery; // Build the rigid body. - let rigid_body = RigidBodyBuilder::new_dynamic() - .translation(vector![x, y]) - .build(); + let rigid_body = RigidBodyBuilder::new_dynamic().translation(vector![x, y]); let handle = bodies.insert(rigid_body); - let collider = ColliderBuilder::cuboid(rad, rad).build(); + let collider = ColliderBuilder::cuboid(rad, rad); colliders.insert_with_parent(collider, handle, &mut bodies); } } @@ -38,7 +36,7 @@ pub fn init_world(testbed: &mut Testbed) { /* * Setup a velocity-based kinematic rigid body. */ - let platform_body = RigidBodyBuilder::new_kinematic_velocity_based().build(); + let platform_body = RigidBodyBuilder::new_kinematic_velocity_based(); let velocity_based_platform_handle = bodies.insert(platform_body); let sides = [ @@ -55,11 +53,11 @@ pub fn init_world(testbed: &mut Testbed) { ]; for (hx, hy, pos) in sides { - let collider = ColliderBuilder::cuboid(hx, hy).translation(pos).build(); + let collider = ColliderBuilder::cuboid(hx, hy).translation(pos); colliders.insert_with_parent(collider, velocity_based_platform_handle, &mut bodies); } for (r, pos) in balls { - let collider = ColliderBuilder::ball(r).translation(pos).build(); + let collider = ColliderBuilder::ball(r).translation(pos); colliders.insert_with_parent(collider, velocity_based_platform_handle, &mut bodies); } |
