fix cyberbike visibility
This commit is contained in:
parent
ca59748849
commit
efb70e16d0
2 changed files with 11 additions and 4 deletions
13
src/bike.rs
13
src/bike.rs
|
@ -53,12 +53,19 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
let mass_properties = ColliderMassProperties::Density(0.2);
|
let mass_properties = ColliderMassProperties::Density(0.2);
|
||||||
|
|
||||||
let (membership, filter) = BIKE_BODY_COLLISION_GROUP;
|
let (membership, filter) = BIKE_BODY_COLLISION_GROUP;
|
||||||
let bike_collision_group = CollisionGroups::new(membership.into(), filter.into());
|
let bike_collision_group = CollisionGroups::new(membership, filter);
|
||||||
|
|
||||||
|
let scene = asset_server.load("cb-no-y_up.glb#Scene0");
|
||||||
|
|
||||||
|
let spatialbundle = SpatialBundle {
|
||||||
|
transform: xform,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
let bike = commands
|
let bike = commands
|
||||||
.spawn_empty()
|
.spawn_empty()
|
||||||
.insert(RigidBody::Dynamic)
|
.insert(RigidBody::Dynamic)
|
||||||
.insert((xform, GlobalTransform::default()))
|
.insert(spatialbundle)
|
||||||
.insert((
|
.insert((
|
||||||
bcollider_shape,
|
bcollider_shape,
|
||||||
bike_collision_group,
|
bike_collision_group,
|
||||||
|
@ -78,7 +85,7 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
.insert(CyberBikeCollider)
|
.insert(CyberBikeCollider)
|
||||||
.with_children(|rider| {
|
.with_children(|rider| {
|
||||||
rider.spawn(SceneBundle {
|
rider.spawn(SceneBundle {
|
||||||
scene: asset_server.load("cb-no-y_up.glb#Scene0"),
|
scene,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -40,7 +40,7 @@ fn update_input(mut events: EventReader<GamepadEvent>, mut istate: ResMut<InputS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg!(&istate);
|
//dbg!(&istate);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CyberInputPlugin;
|
pub struct CyberInputPlugin;
|
||||||
|
|
Loading…
Reference in a new issue