aboutsummaryrefslogtreecommitdiff
path: root/examples3d/fountain3.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-02-20 12:55:00 +0100
committerSébastien Crozet <sebastien@crozet.re>2022-03-20 21:49:16 +0100
commitfb20d72ee29de9311a81aec6eb9f02fd2aa35fc4 (patch)
tree45827ac4c754c3670d1ddb2f91fc498515d6b3b8 /examples3d/fountain3.rs
parente740493b980dc9856864ead3206a4fa02aff965f (diff)
downloadrapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.tar.gz
rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.tar.bz2
rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.zip
Joint API and joint motors improvements
Diffstat (limited to 'examples3d/fountain3.rs')
-rw-r--r--examples3d/fountain3.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/examples3d/fountain3.rs b/examples3d/fountain3.rs
index 4e47878..31ff15b 100644
--- a/examples3d/fountain3.rs
+++ b/examples3d/fountain3.rs
@@ -17,23 +17,19 @@ pub fn init_world(testbed: &mut Testbed) {
let ground_size = 100.1;
let ground_height = 2.1; // 16.0;
- 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);
// Callback that will be executed on the main loop to handle proximities.
testbed.add_callback(move |mut graphics, physics, _, run_state| {
- let rigid_body = RigidBodyBuilder::new_dynamic()
- .translation(vector![0.0, 10.0, 0.0])
- .build();
+ let rigid_body = RigidBodyBuilder::new_dynamic().translation(vector![0.0, 10.0, 0.0]);
let handle = physics.bodies.insert(rigid_body);
let collider = match run_state.timestep_id % 3 {
- 0 => ColliderBuilder::round_cylinder(rad, rad, rad / 10.0).build(),
- 1 => ColliderBuilder::cone(rad, rad).build(),
- _ => ColliderBuilder::cuboid(rad, rad, rad).build(),
+ 0 => ColliderBuilder::round_cylinder(rad, rad, rad / 10.0),
+ 1 => ColliderBuilder::cone(rad, rad),
+ _ => ColliderBuilder::cuboid(rad, rad, rad),
};
physics