simplify wheels

This commit is contained in:
Joe Ardent 2023-02-15 14:52:29 -08:00
parent d2961bd448
commit fa59a81f05
3 changed files with 4 additions and 20 deletions

View file

@ -76,7 +76,7 @@ pub(super) fn falling_cat(
{ {
let now = Instant::now(); let now = Instant::now();
if (now - debug_instant.0).as_millis() > 500 { if (now - debug_instant.0).as_millis() > 500 {
dbg!(roll_error, pitch_error, &control_vars, mag); //dbg!(roll_error, pitch_error, &control_vars, mag);
debug_instant.0 = now; debug_instant.0 = now;
} }
} }

View file

@ -93,18 +93,8 @@ pub fn spawn_tires(
let revolute_builder = RevoluteJointBuilder::new(Vec3::X); let revolute_builder = RevoluteJointBuilder::new(Vec3::X);
let axel_joint = MultibodyJoint::new(fork_rb_entity, revolute_builder); let axel_joint = MultibodyJoint::new(fork_rb_entity, revolute_builder);
let spatial_bundle = SpatialBundle {
..Default::default()
};
let tire_spundle = SpatialBundle {
..Default::default()
};
commands commands
.spawn(RigidBody::Dynamic) .spawn(RigidBody::Dynamic)
.insert(spatial_bundle)
.insert(( .insert((
wheel_collider, wheel_collider,
mass_props, mass_props,
@ -117,14 +107,8 @@ pub fn spawn_tires(
CyberWheel, CyberWheel,
ExternalForce::default(), ExternalForce::default(),
Restitution::new(0.2), Restitution::new(0.2),
SpatialBundle::default(),
)) ))
.with_children(|wheel| { .insert(pbr_bundle.clone());
wheel.spawn(tire_spundle).insert(pbr_bundle.clone()).insert(
TransformInterpolation {
start: None,
end: None,
},
);
});
} }
} }

View file

@ -26,7 +26,7 @@ fn spawn_planet(
let pcollide = ( let pcollide = (
shape, shape,
Friction { Friction {
coefficient: 0.05, coefficient: 0.8,
..Default::default() ..Default::default()
}, },
Restitution::new(0.0), Restitution::new(0.0),