From f26226dcb7b881092eb2e4cdaa59611e8a470043 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Mon, 14 Mar 2022 15:30:45 -0700 Subject: [PATCH] Just some tweaks. --- src/bike.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/bike.rs b/src/bike.rs index 7612b24..21af96f 100644 --- a/src/bike.rs +++ b/src/bike.rs @@ -23,7 +23,7 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { let mut bbody = RigidBodyBundle::default(); - bbody.damping.angular_damping = 0.8; + bbody.damping.angular_damping = 0.5; bbody.damping.linear_damping = 0.1; bbody.activation = RigidBodyActivation::cannot_sleep().into(); @@ -45,7 +45,7 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { ); let bcollide = ColliderBundle { shape: shape.into(), - mass_properties: ColliderMassProps::Density(0.82).into(), + mass_properties: ColliderMassProps::Density(0.2).into(), flags: ColliderFlags { collision_groups: BIKE_BODY_GROUP, ..Default::default() @@ -81,12 +81,16 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { .id(); // seriously the cyberbike is so fucking huge what the heck - let wheel_positions = vec![-5.1, 4.7, 4.7, -5.1]; - let wheel_rad = 1.55; - let wheel_y = -1.5f32; + let wheel_positions = vec![-5.1, 4.7, -5.1]; + let wheel_y = -1.8f32; for (i, &wheel_z) in wheel_positions.iter().enumerate() { - let wheel_x = if i % 2 == 0 { -2.5 } else { 2.5 }; + let (wheel_x, wheel_rad, stiffness) = match i { + 0 => (-2.6, 0.95, 0.014), + 2 => (2.6, 0.95, 0.014), + 1 => (0.0, 1.2, 0.019), + _ => unreachable!(), + }; let offset = Vec3::new(wheel_x, wheel_y, wheel_z); let trans = xform.translation + offset; let wheel_pos_in_world = Isometry::from_parts(trans.into(), xform.rotation.into()); @@ -102,7 +106,7 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { ccd: RigidBodyCcd { ccd_enabled: true, ccd_max_dist: wheel_rad, - ccd_thickness: 0.1, + ccd_thickness: 0.01, ..Default::default() } .into(), @@ -123,11 +127,11 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { .insert(ColliderDebugRender::from(Color::YELLOW)) .id(); - let (stiffness, damping) = (0.011, 0.25); + let damping = 0.25; let prismatic = PrismaticJoint::new(Vector::y_axis()) .local_anchor1(offset.into()) - .motor_position(-0.2, stiffness, damping); + .motor_position(-0.4, stiffness, damping); commands.spawn_bundle(((JointBuilderComponent::new(prismatic, bike, _wheel_rb)),)); }