diff --git a/backends/bevy_picking_raycast/Cargo.toml b/backends/bevy_picking_raycast/Cargo.toml index 254f6bea..a6cf5ad4 100644 --- a/backends/bevy_picking_raycast/Cargo.toml +++ b/backends/bevy_picking_raycast/Cargo.toml @@ -20,6 +20,6 @@ bevy_render = { version = "0.11", default-features = false } bevy_transform = { version = "0.11", default-features = false } bevy_window = { version = "0.11", default-features = false } -bevy_mod_raycast = "0.14" +bevy_mod_raycast = "0.15" # Local bevy_picking_core = { path = "../../crates/bevy_picking_core", version = "0.15" } diff --git a/backends/bevy_picking_raycast/src/lib.rs b/backends/bevy_picking_raycast/src/lib.rs index 88c5673d..dcbd4961 100644 --- a/backends/bevy_picking_raycast/src/lib.rs +++ b/backends/bevy_picking_raycast/src/lib.rs @@ -96,7 +96,7 @@ pub fn update_hits( .map(|ray| (entity, camera, ray, layers)) }) { - let settings = bevy_mod_raycast::system_param::RaycastSettings { + let settings = RaycastSettings { visibility: RaycastVisibility::MustBeVisibleAndInView, filter: &|entity| { let marker_requirement = diff --git a/examples/bevy_ui.rs b/examples/bevy_ui.rs index 334b2717..c2d5a5b9 100644 --- a/examples/bevy_ui.rs +++ b/examples/bevy_ui.rs @@ -69,7 +69,7 @@ fn setup_3d( PbrBundle { mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -78,7 +78,7 @@ fn setup_3d( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -86,10 +86,10 @@ fn setup_3d( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); commands.spawn((Camera3dBundle { transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y), @@ -138,7 +138,7 @@ impl<'w, 's, 'a> NewButton for EntityCommands<'w, 's, 'a> { ..default() }, ), - ..Default::default() + ..default() }, // Text should not be involved in pick interactions. Pickable::IGNORE, diff --git a/examples/debug.rs b/examples/debug.rs index 60b3a193..f93154f8 100644 --- a/examples/debug.rs +++ b/examples/debug.rs @@ -144,7 +144,7 @@ fn setup_3d( PbrBundle { mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -153,7 +153,7 @@ fn setup_3d( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -161,10 +161,10 @@ fn setup_3d( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); commands.spawn((Camera3dBundle { transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y), @@ -212,7 +212,7 @@ impl<'w, 's, 'a> NewButton for EntityCommands<'w, 's, 'a> { ..default() }, ), - ..Default::default() + ..default() }, // Text should not be involved in pick interactions. Pickable::IGNORE, diff --git a/examples/deselection.rs b/examples/deselection.rs index af331485..5135822d 100644 --- a/examples/deselection.rs +++ b/examples/deselection.rs @@ -24,7 +24,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()), transform: Transform::from_xyz(1.5, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), NoDeselect, // <- When this entity is clicked, other entities won't be deselected. @@ -36,7 +36,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), )); @@ -45,12 +45,12 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }); commands.spawn((Camera3dBundle { transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y), - ..Default::default() + ..default() },)); } diff --git a/examples/drag_and_drop.rs b/examples/drag_and_drop.rs index 283f066a..0535f87d 100644 --- a/examples/drag_and_drop.rs +++ b/examples/drag_and_drop.rs @@ -33,7 +33,7 @@ fn setup( transform: Transform::from_xyz(x as f32 * 200.0, 0.0, z) .with_scale(Vec3::splat(100.)), material: materials.add(ColorMaterial::from(Color::hsl(0.0, 1.0, z))), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. On::>::target_insert(Pickable::IGNORE), // Disable picking diff --git a/examples/egui.rs b/examples/egui.rs index 443149d3..820f902c 100644 --- a/examples/egui.rs +++ b/examples/egui.rs @@ -51,7 +51,7 @@ fn setup( PbrBundle { mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(Color::WHITE.into()), - ..Default::default() + ..default() }, PickableBundle::default(), )); @@ -60,7 +60,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::WHITE.into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), )); @@ -68,13 +68,13 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); commands.spawn((Camera3dBundle { transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y), - ..Default::default() + ..default() },)); } diff --git a/examples/event_listener.rs b/examples/event_listener.rs index b557d7ed..1b387a9f 100644 --- a/examples/event_listener.rs +++ b/examples/event_listener.rs @@ -39,7 +39,7 @@ fn setup( PbrBundle { mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::WHITE.into()), - ..Default::default() + ..default() }, PickableBundle::default(), // Callbacks are just exclusive bevy systems that have access to an event data via @@ -104,7 +104,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 0.4 })), material: materials.add(Color::RED.into()), transform: Transform::from_xyz(0.0, 1.0 + 0.5 * i as f32, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), )); @@ -115,14 +115,14 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, 4.0), - ..Default::default() + ..default() }); commands.spawn((Camera3dBundle { transform: Transform::from_xyz(-2.0, 4.5, 5.0).looking_at(Vec3::Y * 2.0, Vec3::Y), - ..Default::default() + ..default() },)); } diff --git a/examples/many_events.rs b/examples/many_events.rs index 0a419c23..0980cf62 100644 --- a/examples/many_events.rs +++ b/examples/many_events.rs @@ -77,7 +77,7 @@ fn spawn_cube( mesh: mesh.clone(), material: material.clone(), transform, - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )) diff --git a/examples/multiple_windows.rs b/examples/multiple_windows.rs index 06317f1f..2d3b067e 100644 --- a/examples/multiple_windows.rs +++ b/examples/multiple_windows.rs @@ -23,7 +23,7 @@ fn setup( PbrBundle { mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -32,7 +32,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -40,10 +40,10 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); // main camera, cameras default to the primary window // so we don't need to specify that. diff --git a/examples/split_screen.rs b/examples/split_screen.rs index 59d4cf9c..0a792467 100644 --- a/examples/split_screen.rs +++ b/examples/split_screen.rs @@ -25,7 +25,7 @@ fn setup( PbrBundle { mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -34,7 +34,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -42,10 +42,10 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); // Left Camera diff --git a/examples/tinted_highlight.rs b/examples/tinted_highlight.rs index 9cfa01ec..9186572a 100644 --- a/examples/tinted_highlight.rs +++ b/examples/tinted_highlight.rs @@ -49,9 +49,9 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(StandardMaterial { base_color_texture: Some(asset_server.load("images/boovy.png")), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. HIGHLIGHT_TINT, // Override the global highlighting settings for this mesh @@ -63,10 +63,10 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(StandardMaterial { base_color_texture: Some(asset_server.load("images/boovy.png")), - ..Default::default() + ..default() }), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. HIGHLIGHT_TINT, // Override the global highlighting settings for this mesh @@ -77,15 +77,15 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); // camera commands.spawn((Camera3dBundle { transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y), - ..Default::default() + ..default() },)); } diff --git a/examples/virtual_pointer.rs b/examples/virtual_pointer.rs index b3feb31a..6a7a4444 100644 --- a/examples/virtual_pointer.rs +++ b/examples/virtual_pointer.rs @@ -63,7 +63,7 @@ fn setup( PbrBundle { mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))), material: materials.add(Color::WHITE.into()), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -74,7 +74,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })), material: materials.add(Color::WHITE.into()), transform: Transform::from_xyz(0.0, 0.5, 0.0), - ..Default::default() + ..default() }, PickableBundle::default(), // <- Makes the mesh pickable. )); @@ -84,15 +84,15 @@ fn setup( point_light: PointLight { intensity: 1500.0, shadows_enabled: true, - ..Default::default() + ..default() }, transform: Transform::from_xyz(4.0, 8.0, -4.0), - ..Default::default() + ..default() }); // camera commands.spawn((Camera3dBundle { transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y), - ..Default::default() + ..default() },)); }