From 0f330283eebf5a859b589a4cd46737a01a546276 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Sun, 19 Feb 2023 14:31:20 -0800 Subject: [PATCH] increase friction coefficients to more realistic values --- src/bike/body.rs | 4 ++-- src/bike/components.rs | 2 +- src/bike/wheels.rs | 1 - src/planet.rs | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bike/body.rs b/src/bike/body.rs index 4216915..d841c14 100644 --- a/src/bike/body.rs +++ b/src/bike/body.rs @@ -16,7 +16,7 @@ pub(super) fn spawn_cyberbike( wheel_conf: Res, mut meshterials: Meshterial, ) { - let altitude = PLANET_RADIUS - 100.0; + let altitude = PLANET_RADIUS - 180.0; let mut xform = Transform::from_translation(Vec3::X * altitude) .with_rotation(Quat::from_axis_angle(Vec3::Z, -89.0f32.to_radians())); @@ -81,5 +81,5 @@ pub(super) fn spawn_cyberbike( .insert(CatControllerState::default()) .id(); - spawn_tires(&mut commands, &xform, bike, &wheel_conf, &mut meshterials); + spawn_tires(&mut commands, bike, &wheel_conf, &mut meshterials); } diff --git a/src/bike/components.rs b/src/bike/components.rs index a7918ff..6d222e2 100644 --- a/src/bike/components.rs +++ b/src/bike/components.rs @@ -37,7 +37,7 @@ impl Default for WheelConfig { stiffness: 90.0, damping: 8.0, radius: 0.3, - friction: 0.9, + friction: 1.2, restitution: 0.8, density: 0.9, } diff --git a/src/bike/wheels.rs b/src/bike/wheels.rs index 3bf9949..d18fa5b 100644 --- a/src/bike/wheels.rs +++ b/src/bike/wheels.rs @@ -9,7 +9,6 @@ use super::{CyberSteering, CyberWheel, Meshterial, WheelConfig, BIKE_WHEEL_COLLI pub fn spawn_tires( commands: &mut Commands, - _xform: &Transform, bike: Entity, conf: &WheelConfig, meshterials: &mut Meshterial, diff --git a/src/planet.rs b/src/planet.rs index eb19646..8e6807b 100644 --- a/src/planet.rs +++ b/src/planet.rs @@ -32,7 +32,7 @@ fn spawn_planet( let pcollide = ( shape, Friction { - coefficient: 0.8, + coefficient: 1.2, ..Default::default() }, Restitution::new(0.8),