Compare commits
2 commits
bf2d9727f5
...
610f141318
Author | SHA1 | Date | |
---|---|---|---|
|
610f141318 | ||
|
061583648d |
1 changed files with 9 additions and 2 deletions
11
src/bike.rs
11
src/bike.rs
|
@ -37,7 +37,7 @@ fn spawn_bike(
|
||||||
.with_children(|builder| {
|
.with_children(|builder| {
|
||||||
let color = Color::srgb(0.7, 0.05, 0.7);
|
let color = Color::srgb(0.7, 0.05, 0.7);
|
||||||
let mut rotation = Transform::default(); // Transform::from_rotation(Quat::from_rotation_y(FRAC_PI_2));
|
let mut rotation = Transform::default(); // Transform::from_rotation(Quat::from_rotation_y(FRAC_PI_2));
|
||||||
rotation.rotate_y(FRAC_PI_2);
|
rotation.rotate_x(FRAC_PI_2);
|
||||||
let pbr_bundle = PbrBundle {
|
let pbr_bundle = PbrBundle {
|
||||||
mesh: meshes.add(Capsule3d::new(0.5, 1.45)),
|
mesh: meshes.add(Capsule3d::new(0.5, 1.45)),
|
||||||
transform: rotation,
|
transform: rotation,
|
||||||
|
@ -87,7 +87,6 @@ fn helper(
|
||||||
FrontHub,
|
FrontHub,
|
||||||
SpatialBundle::from_transform(Transform::from_translation(trans)),
|
SpatialBundle::from_transform(Transform::from_translation(trans)),
|
||||||
RigidBody::Static,
|
RigidBody::Static,
|
||||||
Mesh::from(Sphere::new(0.1)),
|
|
||||||
))
|
))
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
let mesh: Mesh = Sphere::new(0.1).into();
|
let mesh: Mesh = Sphere::new(0.1).into();
|
||||||
|
@ -97,6 +96,14 @@ fn helper(
|
||||||
transform: Transform::from_rotation(rot),
|
transform: Transform::from_rotation(rot),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
parent.spawn((
|
||||||
|
CyberWheel,
|
||||||
|
RigidBody::Dynamic,
|
||||||
|
collider.clone(),
|
||||||
|
ColliderDensity(0.05),
|
||||||
|
CollisionLayers::from_bits(2, 2),
|
||||||
|
ExternalTorque::ZERO.with_persistence(false),
|
||||||
|
));
|
||||||
})
|
})
|
||||||
.id();
|
.id();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue