Skip to content

Commit

Permalink
bump mod_raycast and switch to bevy ..default()
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Oct 30, 2023
1 parent 6dfad7a commit ed28965
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion backends/bevy_picking_raycast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion backends/bevy_picking_raycast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
10 changes: 5 additions & 5 deletions examples/bevy_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
));
Expand All @@ -78,18 +78,18 @@ 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.
));
commands.spawn(PointLightBundle {
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),
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions examples/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
));
Expand All @@ -153,18 +153,18 @@ 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.
));
commands.spawn(PointLightBundle {
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),
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions examples/deselection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(),
));
Expand All @@ -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()
},));
}
2 changes: 1 addition & 1 deletion examples/drag_and_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Pointer<DragStart>>::target_insert(Pickable::IGNORE), // Disable picking
Expand Down
10 changes: 5 additions & 5 deletions examples/egui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
));
Expand All @@ -60,21 +60,21 @@ 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(),
));
commands.spawn(PointLightBundle {
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()
},));
}
10 changes: 5 additions & 5 deletions examples/event_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
));
Expand All @@ -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()
},));
}

Expand Down
2 changes: 1 addition & 1 deletion examples/many_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn spawn_cube(
mesh: mesh.clone(),
material: material.clone(),
transform,
..Default::default()
..default()
},
PickableBundle::default(), // <- Makes the mesh pickable.
))
Expand Down
8 changes: 4 additions & 4 deletions examples/multiple_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
));
Expand All @@ -32,18 +32,18 @@ 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.
));
commands.spawn(PointLightBundle {
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.
Expand Down
8 changes: 4 additions & 4 deletions examples/split_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
));
Expand All @@ -34,18 +34,18 @@ 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.
));
commands.spawn(PointLightBundle {
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
Expand Down
14 changes: 7 additions & 7 deletions examples/tinted_highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
},));
}
10 changes: 5 additions & 5 deletions examples/virtual_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
));
Expand All @@ -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.
));
Expand All @@ -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()
},));
}

0 comments on commit ed28965

Please sign in to comment.