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 /examples3d/compound3.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 'examples3d/compound3.rs')
| -rw-r--r-- | examples3d/compound3.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/examples3d/compound3.rs b/examples3d/compound3.rs index 433210d..5ecccb9 100644 --- a/examples3d/compound3.rs +++ b/examples3d/compound3.rs @@ -16,11 +16,9 @@ pub fn init_world(testbed: &mut Testbed) { let ground_size = 50.0; let ground_height = 0.1; - let rigid_body = RigidBodyBuilder::new_static() - .translation(vector![0.0, -ground_height, 0.0]) - .build(); + let rigid_body = RigidBodyBuilder::new_static().translation(vector![0.0, -ground_height, 0.0]); let handle = bodies.insert(rigid_body); - let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build(); + let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size); colliders.insert_with_parent(collider, handle, &mut bodies); /* @@ -45,20 +43,16 @@ pub fn init_world(testbed: &mut Testbed) { let z = k as f32 * shift * 2.0 - centerz + offset; // Build the rigid body. - let rigid_body = RigidBodyBuilder::new_dynamic() - .translation(vector![x, y, z]) - .build(); + let rigid_body = RigidBodyBuilder::new_dynamic().translation(vector![x, y, z]); let handle = bodies.insert(rigid_body); // First option: attach several colliders to a single rigid-body. if j < numy / 2 { - let collider1 = ColliderBuilder::cuboid(rad * 10.0, rad, rad).build(); + let collider1 = ColliderBuilder::cuboid(rad * 10.0, rad, rad); let collider2 = ColliderBuilder::cuboid(rad, rad * 10.0, rad) - .translation(vector![rad * 10.0, rad * 10.0, 0.0]) - .build(); + .translation(vector![rad * 10.0, rad * 10.0, 0.0]); let collider3 = ColliderBuilder::cuboid(rad, rad * 10.0, rad) - .translation(vector![-rad * 10.0, rad * 10.0, 0.0]) - .build(); + .translation(vector![-rad * 10.0, rad * 10.0, 0.0]); colliders.insert_with_parent(collider1, handle, &mut bodies); colliders.insert_with_parent(collider2, handle, &mut bodies); colliders.insert_with_parent(collider3, handle, &mut bodies); @@ -79,7 +73,7 @@ pub fn init_world(testbed: &mut Testbed) { ), ]; - let collider = ColliderBuilder::compound(shapes).build(); + let collider = ColliderBuilder::compound(shapes); colliders.insert_with_parent(collider, handle, &mut bodies); } } |
