From efb70e16d0f87ca37c81537385de15c8775368f7 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Fri, 20 Jan 2023 15:07:37 -0800 Subject: [PATCH] fix cyberbike visibility --- src/bike.rs | 13 ++++++++++--- src/input.rs | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/bike.rs b/src/bike.rs index 610e812..46c998f 100644 --- a/src/bike.rs +++ b/src/bike.rs @@ -53,12 +53,19 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { let mass_properties = ColliderMassProperties::Density(0.2); 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 .spawn_empty() .insert(RigidBody::Dynamic) - .insert((xform, GlobalTransform::default())) + .insert(spatialbundle) .insert(( bcollider_shape, bike_collision_group, @@ -78,7 +85,7 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res) { .insert(CyberBikeCollider) .with_children(|rider| { rider.spawn(SceneBundle { - scene: asset_server.load("cb-no-y_up.glb#Scene0"), + scene, ..Default::default() }); }) diff --git a/src/input.rs b/src/input.rs index d5eadbd..e075b4e 100644 --- a/src/input.rs +++ b/src/input.rs @@ -40,7 +40,7 @@ fn update_input(mut events: EventReader, mut istate: ResMut