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 --- benchmarks3d/stacks3.rs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'benchmarks3d/stacks3.rs') diff --git a/benchmarks3d/stacks3.rs b/benchmarks3d/stacks3.rs index 7fc9097..ff67917 100644 --- a/benchmarks3d/stacks3.rs +++ b/benchmarks3d/stacks3.rs @@ -23,10 +23,9 @@ fn create_tower_circle( * Translation::new(0.0, y, radius); // Build the rigid body. - let rigid_body = RigidBodyBuilder::new_dynamic().position(pos).build(); + let rigid_body = RigidBodyBuilder::new_dynamic().position(pos); let handle = bodies.insert(rigid_body); - let collider = - ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build(); + let collider = ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z); colliders.insert_with_parent(collider, handle, bodies); } } @@ -50,12 +49,9 @@ fn create_wall( - stack_height as f32 * half_extents.z; // 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); - let collider = - ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build(); + let collider = ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z); colliders.insert_with_parent(collider, handle, bodies); } } @@ -83,12 +79,10 @@ fn create_pyramid( - stack_height as f32 * half_extents.z; // 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); let collider = - ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build(); + ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z); colliders.insert_with_parent(collider, handle, bodies); } } @@ -110,11 +104,9 @@ pub fn init_world(testbed: &mut Testbed) { let ground_size = 200.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); /* -- cgit