diff --git a/src/bike.rs b/src/bike.rs index 6504a17..1816a2c 100644 --- a/src/bike.rs +++ b/src/bike.rs @@ -44,7 +44,7 @@ fn spawn_bike( SleepingDisabled, CyberBikeBody, CatControllerState::default(), - ColliderDensity(0.4), + ColliderDensity(20.0), LinearDamping(0.1), AngularDamping(2.0), LinearVelocity::ZERO, @@ -163,7 +163,7 @@ fn wheels_helper( Name::new("hub"), SpatialBundle::from_transform(xform), RigidBody::Dynamic, - MassPropertiesBundle::new_computed(&Collider::sphere(0.1), 8.0), + MassPropertiesBundle::new_computed(&Collider::sphere(0.1), 200.0), )) .with_children(|parent| { let mesh: Mesh = Sphere::new(0.1).into(); @@ -182,9 +182,9 @@ fn wheels_helper( CyberWheel, RigidBody::Dynamic, collider, - Friction::new(3.0).with_dynamic_coefficient(0.9), + Friction::new(0.9).with_dynamic_coefficient(0.6), Restitution::new(0.1), - ColliderDensity(0.1), + ColliderDensity(30.0), CollisionLayers::from_bits(2, 2), ExternalTorque::ZERO.with_persistence(false), CollisionMargin(0.05), diff --git a/src/main.rs b/src/main.rs index dbc8c63..3af1149 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,13 +47,13 @@ fn ground_and_light( Collider::cuboid(50.0, 0.5, 50.0), CollisionMargin(0.1), ColliderDensity(1000.0), - Friction::new(3.0), + Friction::new(0.9), )) .with_children(|p| { p.spawn(PbrBundle { mesh: meshes.add(Plane3d::default().mesh().size(50.0, 50.0)), material: materials.add(Color::from(SILVER)), - transform: Transform::from_xyz(0.0, 0.5, 0.0), + transform: Transform::from_xyz(0.0, 1.0, 0.0), ..default() }); }); diff --git a/src/physics.rs b/src/physics.rs index 7ba5c83..cffcfbd 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -18,9 +18,9 @@ pub struct CatControllerSettings { impl Default for CatControllerSettings { fn default() -> Self { Self { - kp: 20.0, - kd: 2.0, - ki: 0.7, + kp: 950.0, + kd: 10.0, + ki: 50.0, } } }