diff options
| author | pellico <pellico@users.noreply.github.com> | 2022-11-28 16:47:15 +0100 |
|---|---|---|
| committer | Sébastien Crozet <sebcrozet@dimforge.com> | 2023-12-10 12:43:13 +0100 |
| commit | 9f3b5c86421e957e94f14e23b7e9912ada88d7e2 (patch) | |
| tree | 25bd9f687ac028241e48e6a59af353c5c51cf480 /examples2d/joint_motor_position2.rs | |
| parent | 6432909110c4b96e59d4ee2ebdae1d79abe8d4b3 (diff) | |
| download | rapier-9f3b5c86421e957e94f14e23b7e9912ada88d7e2.tar.gz rapier-9f3b5c86421e957e94f14e23b7e9912ada88d7e2.tar.bz2 rapier-9f3b5c86421e957e94f14e23b7e9912ada88d7e2.zip | |
Fixed formatting of modified files.
Diffstat (limited to 'examples2d/joint_motor_position2.rs')
| -rw-r--r-- | examples2d/joint_motor_position2.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/examples2d/joint_motor_position2.rs b/examples2d/joint_motor_position2.rs index 5a79874..a701bd0 100644 --- a/examples2d/joint_motor_position2.rs +++ b/examples2d/joint_motor_position2.rs @@ -25,7 +25,7 @@ pub fn init_world(testbed: &mut Testbed) { * A rectangle on a motor */ for num in 0..9 { - let x_pos = -6.0 + 1.5 * num as f32; + let x_pos = -6.0 + 1.5 * num as f32; let rigid_body = RigidBodyBuilder::dynamic().translation(vector![x_pos, 2.0]); let handle = bodies.insert(rigid_body); let collider = ColliderBuilder::cuboid(0.1, 0.5); @@ -34,13 +34,20 @@ pub fn init_world(testbed: &mut Testbed) { let joint = RevoluteJointBuilder::new() .local_anchor2(point![x_pos, 1.5]) .local_anchor1(point![0.0, -0.5]) - .motor_position(std::f32::consts::PI/4.0*num as f32, 100.0, 15.0); - impulse_joints.insert(handle,ground_handle, joint, true); + .motor_position(std::f32::consts::PI / 4.0 * num as f32, 100.0, 15.0); + impulse_joints.insert(handle, ground_handle, joint, true); } /* * Set up the testbed. */ - testbed.set_world_with_params(bodies, colliders, impulse_joints, multibody_joints,vector![0.0,0.0],()); + testbed.set_world_with_params( + bodies, + colliders, + impulse_joints, + multibody_joints, + vector![0.0, 0.0], + (), + ); testbed.look_at(point![0.0, 0.0], 40.0); } |
