Merge branch 'smoothland'
This adds rake and trail to the front, as well as increases the density/mass of the wheels, while adding that parameter to the WheelConfig.
This commit is contained in:
commit
faafb18e44
3 changed files with 10 additions and 6 deletions
|
@ -16,7 +16,6 @@ pub struct CyberWheel;
|
||||||
#[reflect(Resource)]
|
#[reflect(Resource)]
|
||||||
pub struct WheelConfig {
|
pub struct WheelConfig {
|
||||||
pub front_forward: f32,
|
pub front_forward: f32,
|
||||||
pub front_stance: f32,
|
|
||||||
pub rear_back: f32,
|
pub rear_back: f32,
|
||||||
pub y: f32,
|
pub y: f32,
|
||||||
pub limits: [f32; 2],
|
pub limits: [f32; 2],
|
||||||
|
@ -25,13 +24,13 @@ pub struct WheelConfig {
|
||||||
pub radius: f32,
|
pub radius: f32,
|
||||||
pub friction: f32,
|
pub friction: f32,
|
||||||
pub restitution: f32,
|
pub restitution: f32,
|
||||||
|
pub density: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for WheelConfig {
|
impl Default for WheelConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
front_forward: 0.9,
|
front_forward: 0.8,
|
||||||
front_stance: 0.65,
|
|
||||||
rear_back: 1.1,
|
rear_back: 1.1,
|
||||||
y: -0.1,
|
y: -0.1,
|
||||||
limits: [-0.7, 0.1],
|
limits: [-0.7, 0.1],
|
||||||
|
@ -40,6 +39,7 @@ impl Default for WheelConfig {
|
||||||
radius: 0.3,
|
radius: 0.3,
|
||||||
friction: 0.9,
|
friction: 0.9,
|
||||||
restitution: 0.8,
|
restitution: 0.8,
|
||||||
|
density: 0.9,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ pub fn spawn_tires(
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let wheel_collider = Collider::ball(wheel_rad);
|
let wheel_collider = Collider::ball(wheel_rad);
|
||||||
let mass_props = ColliderMassProperties::Density(0.1);
|
let mass_props = ColliderMassProperties::Density(conf.density);
|
||||||
let damping = conf.damping;
|
let damping = conf.damping;
|
||||||
|
|
||||||
let prismatic_axis = if steering.is_some() {
|
let prismatic_axis = if steering.is_some() {
|
||||||
|
@ -96,7 +96,8 @@ pub fn spawn_tires(
|
||||||
.id();
|
.id();
|
||||||
|
|
||||||
let axel_parent_entity = if let Some(steering) = steering {
|
let axel_parent_entity = if let Some(steering) = steering {
|
||||||
let neck_builder = RevoluteJointBuilder::new(Vec3::Y);
|
let neck_builder =
|
||||||
|
RevoluteJointBuilder::new(Vec3::Y).local_anchor1(Vec3::new(0.0, 0.0, 0.1));
|
||||||
let neck_joint = MultibodyJoint::new(fork_rb_entity, neck_builder);
|
let neck_joint = MultibodyJoint::new(fork_rb_entity, neck_builder);
|
||||||
let neck = commands
|
let neck = commands
|
||||||
.spawn(RigidBody::Dynamic)
|
.spawn(RigidBody::Dynamic)
|
||||||
|
|
|
@ -5,10 +5,13 @@ use cyber_rider::{
|
||||||
planet::CyberPlanetPlugin, ui::CyberUIPlugin,
|
planet::CyberPlanetPlugin, ui::CyberUIPlugin,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const CYBER_SKY: Color = Color::rgb(0.07, 0.001, 0.02);
|
||||||
|
// const CYBER_SKY: Color = Color::rgb(0.64, 0.745, 0.937);
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut app = App::new();
|
let mut app = App::new();
|
||||||
app.insert_resource(Msaa { samples: 4 })
|
app.insert_resource(Msaa { samples: 4 })
|
||||||
.insert_resource(ClearColor(Color::rgb(0.07, 0.001, 0.02)))
|
.insert_resource(ClearColor(CYBER_SKY))
|
||||||
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||||
window: WindowDescriptor {
|
window: WindowDescriptor {
|
||||||
width: 2560.0,
|
width: 2560.0,
|
||||||
|
|
Loading…
Reference in a new issue