Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Oct 27, 2023
1 parent f8348cd commit 1fd587a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
7 changes: 3 additions & 4 deletions backends/bevy_picking_raycast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ pub struct RaycastBackendSettings {
pub require_markers: bool,
}

/// This unit struct is used to tag the generic ray casting types
/// [`RaycastMesh`](bevy_mod_raycast::RaycastMesh) and
/// [`RaycastSource`](bevy_mod_raycast::RaycastSource).
/// This unit struct is used to tag the generic ray casting types [`RaycastMesh`] and
/// [`RaycastSource`].
#[derive(Reflect, Clone)]
pub struct RaycastPickingSet;

/// Marks an entity that should be pickable with [`bevy_mod_raycast`] ray casts. Only needed if
/// [`RaycastBackendSettings::require_markers`] is set to true.
pub type RaycastPickTarget = bevy_mod_raycast::RaycastMesh<RaycastPickingSet>;
pub type RaycastPickTarget = RaycastMesh<RaycastPickingSet>;

/// Marks a camera that should be used for picking with [`bevy_mod_raycast`]. Only needed if
/// [`RaycastBackendSettings::require_markers`] is set to true.
Expand Down
5 changes: 2 additions & 3 deletions examples/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fn main() {
.run();
}

// Spawn a simple scene, like bevy's 3d_scene example.
fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
Expand All @@ -26,7 +25,7 @@ fn setup(
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
..default()
},
PickableBundle::default(), // Adds selection, highlighting, and the `Pickable` override.
PickableBundle::default(), // Optional: adds selection, highlighting, and helper components.
));
commands.spawn((
PbrBundle {
Expand All @@ -35,7 +34,7 @@ fn setup(
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
},
PickableBundle::default(), // Adds selection, highlighting, and the `Pickable` override.
PickableBundle::default(), // Optional: adds selection, highlighting, and helper components.
));
commands.spawn(PointLightBundle {
point_light: PointLight {
Expand Down
13 changes: 6 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@
//!
//! #### Backend ([`bevy_picking_core::backend`])
//!
//! A picking backend only has one job: reading [`PointerLocation`](crate::pointer::PointerLocation)
//! components, and producing [`PointerHits`](crate::backend::PointerHits).
//! A picking backend only has one job: reading [`PointerLocation`] components, and producing
//! [`PointerHits`](crate::backend::PointerHits).
//!
//! You will eventually need to choose which picking backend(s) you want to use. This plugin uses
//! `bevy_mod_raycast` by default; it works with bevy `Mesh`es out of the box and requires no extra
Expand All @@ -148,9 +148,8 @@
//! just because a pointer is over an entity, it is not necessarily hovering that entity. Although
//! multiple backends may be reporting that a pointer is over an entity, the focus system needs to
//! determine which one(s) are actually being hovered based on the pick depth, order of the backend,
//! and the [`Pickable`](bevy_picking_core::Pickable) state of the entity. In other words, if one
//! entity is in front of another, only the topmost one will be hovered, even if the pointer is
//! within the bounds of both entities.
//! and the [`Pickable`] state of the entity. In other words, if one entity is in front of another,
//! only the topmost one will be hovered, even if the pointer is within the bounds of both entities.
//!
//! #### Events ([`bevy_picking_core::events`])
//!
Expand Down Expand Up @@ -244,10 +243,10 @@ pub struct PickableBundle {
pub pickable: Pickable,
/// Tracks entity interaction state.
pub interaction: focus::PickingInteraction,
/// Tracks entity [`PickSelection`](selection::PickSelection) state.
/// Tracks entity [`PickSelection`] state.
#[cfg(feature = "selection")]
pub selection: selection::PickSelection,
/// Tracks entity [`PickHighlight`](highlight::PickHighlight) state.
/// Tracks entity [`PickHighlight`] state.
#[cfg(feature = "highlight")]
pub highlight: highlight::PickHighlight,
}
Expand Down

0 comments on commit 1fd587a

Please sign in to comment.