Skip to content

Commit

Permalink
Fixes for upstream bevyengine/bevy#1703
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Mar 23, 2021
1 parent 88a3a09 commit 74274dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
17 changes: 9 additions & 8 deletions examples/mouse_picking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ fn setup(
mut materials: ResMut<Assets<StandardMaterial>>,
) {
commands
.spawn(PerspectiveCameraBundle {
.spawn_bundle(PerspectiveCameraBundle {
transform: Transform::from_matrix(Mat4::face_toward(
Vec3::new(-3.0, 5.0, 8.0),
Vec3::new(0.0, 0.0, 0.0),
Vec3::new(0.0, 1.0, 0.0),
)),
..Default::default()
})
.with(RayCastSource::<MyRaycastSet>::new()) // Designate the camera as our source
.spawn(PbrBundle {
.insert(RayCastSource::<MyRaycastSet>::new()); // Designate the camera as our source
commands
.spawn_bundle(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Icosphere {
subdivisions: 20,
radius: 2.0,
Expand All @@ -72,9 +73,9 @@ fn setup(
transform: Transform::from_translation(Vec3::ZERO),
..Default::default()
})
.with(RayCastMesh::<MyRaycastSet>::default()) // Make this mesh ray cast-able
.spawn(LightBundle {
transform: Transform::from_translation(Vec3::new(4.0, 8.0, 4.0)),
..Default::default()
});
.insert(RayCastMesh::<MyRaycastSet>::default()); // Make this mesh ray cast-able
commands.spawn_bundle(LightBundle {
transform: Transform::from_translation(Vec3::new(4.0, 8.0, 4.0)),
..Default::default()
});
}
12 changes: 6 additions & 6 deletions src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub fn update_debug_cursor<T: 'static + Send + Sync>(
});
commands
// cursor
.spawn(PbrBundle {
.spawn_bundle(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Icosphere {
subdivisions: 4,
radius: ball_size,
Expand All @@ -86,17 +86,17 @@ pub fn update_debug_cursor<T: 'static + Send + Sync>(

// child cube
parent
.spawn(PbrBundle {
.spawn_bundle(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Cube { size: cube_size })),
material: debug_material.clone(),
transform,
..Default::default()
})
.with(DebugCursorTail::<T>::default())
.with(DebugCursorMesh::<T>::default());
.insert(DebugCursorTail::<T>::default())
.insert(DebugCursorMesh::<T>::default());
})
.with(DebugCursor::<T>::default())
.with(DebugCursorMesh::<T>::default());
.insert(DebugCursor::<T>::default())
.insert(DebugCursorMesh::<T>::default());
}

// Set the cursor translation to the top pick's world coordinates
Expand Down

0 comments on commit 74274dd

Please sign in to comment.