chore: clippy fixes

This commit is contained in:
Sébastien Crozet
2024-04-28 18:23:30 +02:00
committed by Sébastien Crozet
parent 929aa6b925
commit 0a9153e273
29 changed files with 38 additions and 52 deletions

View File

@@ -10,6 +10,7 @@ pub fn init_world(testbed: &mut Testbed) {
let impulse_joints = ImpulseJointSet::new();
let multibody_joints = MultibodyJointSet::new();
#[allow(clippy::excessive_precision)]
let mut ps1 = [
Point::new(16.0, 0.0),
Point::new(14.93803712795643, 5.133601056842984),
@@ -22,6 +23,7 @@ pub fn init_world(testbed: &mut Testbed) {
Point::new(2.405937953536585, 39.09554102558315),
];
#[allow(clippy::excessive_precision)]
let mut ps2 = [
Point::new(24.0, 0.0),
Point::new(22.33619528222415, 6.02299846205841),

View File

@@ -24,7 +24,7 @@ pub fn init_world(testbed: &mut Testbed) {
let friction = 0.6;
let capsule = ColliderBuilder::capsule_x(hx, 0.125)
.friction(friction)
.density(20.0);
.density(density);
let mut prev = ground;
for i in 0..count {
@@ -55,7 +55,7 @@ pub fn init_world(testbed: &mut Testbed) {
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::ball(radius)
.friction(friction)
.density(20.0);
.density(density);
colliders.insert_with_parent(collider, handle, &mut bodies);
let pivot = point![(2.0 * count as f32) * hx, count as f32 * hx];
@@ -64,7 +64,6 @@ pub fn init_world(testbed: &mut Testbed) {
.local_anchor2(bodies[handle].position().inverse_transform_point(&pivot))
.contacts_enabled(false);
impulse_joints.insert(prev, handle, joint, true);
prev = handle;
/*
* Set up the testbed.

View File

@@ -29,7 +29,7 @@ pub fn init_world(testbed: &mut Testbed) {
.angular_damping(0.1)
.translation(vector![x_base + 0.5 + 1.0 * i as f32, 20.0]);
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(0.5, 0.125).density(20.0);
let collider = ColliderBuilder::cuboid(0.5, 0.125).density(density);
colliders.insert_with_parent(collider, handle, &mut bodies);
let pivot = point![x_base + 1.0 * i as f32, 20.0];

View File

@@ -10,7 +10,6 @@ pub fn init_world(testbed: &mut Testbed) {
let impulse_joints = ImpulseJointSet::new();
let multibody_joints = MultibodyJointSet::new();
let extent = 1.0;
let friction = 0.7;
/*

View File

@@ -38,13 +38,13 @@ pub fn init_world(testbed: &mut Testbed) {
/*
* Create the spheres
*/
let mut row = 0;
let mut row;
let mut count = 0;
let mut column = 0;
while count < max_count {
row = 0;
for i in 0..grid_count {
for _ in 0..grid_count {
let x = -8.75 + column as f32 * 18.0 / (grid_count as f32);
let y = 1.5 + row as f32 * 18.0 / (grid_count as f32);
let body = RigidBodyBuilder::dynamic()

View File

@@ -11,7 +11,6 @@ pub fn init_world(testbed: &mut Testbed) {
let multibody_joints = MultibodyJointSet::new();
let origin = vector![100_000.0, -80_000.0];
let extent = 1.0;
let friction = 0.6;
/*

View File

@@ -16,8 +16,6 @@ pub fn init_world(testbed: &mut Testbed) {
/*
* Ground
*/
let ground_width = 66.0 * extent;
let rigid_body = RigidBodyBuilder::fixed().translation(vector![0.0, -2.0]);
let ground_handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(40.0, 2.0).friction(friction);

View File

@@ -11,12 +11,7 @@ pub fn init_world(testbed: &mut Testbed) {
let multibody_joints = MultibodyJointSet::new();
/*
* Ground
*/
let ground = bodies.insert(RigidBodyBuilder::fixed());
/*
* Create the bridge.
* Create the joint grid.
*/
let rad = 0.4;
let numi = 100;

View File

@@ -10,8 +10,6 @@ pub fn init_world(testbed: &mut Testbed) {
let impulse_joints = ImpulseJointSet::new();
let multibody_joints = MultibodyJointSet::new();
let extent = 1.0;
/*
* Ground
*/