aboutsummaryrefslogtreecommitdiff
path: root/examples2d
diff options
context:
space:
mode:
authorpellico <pellico@users.noreply.github.com>2022-11-28 16:47:15 +0100
committerSébastien Crozet <sebcrozet@dimforge.com>2023-12-10 12:43:13 +0100
commit9f3b5c86421e957e94f14e23b7e9912ada88d7e2 (patch)
tree25bd9f687ac028241e48e6a59af353c5c51cf480 /examples2d
parent6432909110c4b96e59d4ee2ebdae1d79abe8d4b3 (diff)
downloadrapier-9f3b5c86421e957e94f14e23b7e9912ada88d7e2.tar.gz
rapier-9f3b5c86421e957e94f14e23b7e9912ada88d7e2.tar.bz2
rapier-9f3b5c86421e957e94f14e23b7e9912ada88d7e2.zip
Fixed formatting of modified files.
Diffstat (limited to 'examples2d')
-rw-r--r--examples2d/all_examples2.rs2
-rw-r--r--examples2d/joint_motor_position2.rs15
2 files changed, 12 insertions, 5 deletions
diff --git a/examples2d/all_examples2.rs b/examples2d/all_examples2.rs
index fff20c5..032e4d6 100644
--- a/examples2d/all_examples2.rs
+++ b/examples2d/all_examples2.rs
@@ -16,8 +16,8 @@ mod convex_polygons2;
mod damping2;
mod debug_box_ball2;
mod drum2;
-mod joint_motor_position2;
mod heightfield2;
+mod joint_motor_position2;
mod joints2;
mod locked_rotations2;
mod one_way_platforms2;
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);
}