Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spatial query doc tests #546

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/spatial_query/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use bevy::{ecs::system::SystemParam, prelude::*};
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// ) {
/// println!("First hit: {:?}", first_hit);
/// }
Expand All @@ -50,7 +50,7 @@ use bevy::{ecs::system::SystemParam, prelude::*};
/// 100.0, // Maximum time of impact (travel distance)
/// 20, // Maximum number of hits
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// );
///
/// // Print hits
Expand Down Expand Up @@ -115,7 +115,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// ) {
/// println!("First hit: {:?}", first_hit);
/// }
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// &|entity| { // Predicate
/// // Skip entities with the `Invisible` component.
/// !query.contains(entity)
Expand Down Expand Up @@ -229,7 +229,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// 100.0, // Maximum time of impact (travel distance)
/// 20, // Maximum number of hits
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// );
///
/// // Print hits
Expand Down Expand Up @@ -291,7 +291,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// |hit| { // Callback function
/// hits.push(hit);
/// true
Expand Down Expand Up @@ -359,7 +359,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Should initial penetration at the origin be ignored
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// ) {
/// println!("First hit: {:?}", first_hit);
/// }
Expand Down Expand Up @@ -424,7 +424,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// 100.0, // Maximum time of impact (travel distance)
/// 20, // Max hits
/// true, // Should initial penetration at the origin be ignored
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// );
///
/// // Print hits
Expand Down Expand Up @@ -495,7 +495,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Should initial penetration at the origin be ignored
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |hit| { // Callback function
/// hits.push(hit);
/// true
Expand Down Expand Up @@ -557,7 +557,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// if let Some(projection) = spatial_query.project_point(
/// Vec3::ZERO, // Point
/// true, // Are colliders treated as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(),// Query filter
/// ) {
/// println!("Projection: {:?}", projection);
/// }
Expand Down Expand Up @@ -593,7 +593,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// # #[cfg(all(feature = "3d", feature = "f32"))]
/// fn print_point_intersections(spatial_query: SpatialQuery) {
/// let intersections =
/// spatial_query.point_intersections(Vec3::ZERO, SpatialQueryFilter::default());
/// spatial_query.point_intersections(Vec3::ZERO, &SpatialQueryFilter::default());
///
/// for entity in intersections.iter() {
/// println!("Entity: {:?}", entity);
Expand Down Expand Up @@ -633,7 +633,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
///
/// spatial_query.point_intersections_callback(
/// Vec3::ZERO, // Point
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |entity| { // Callback function
/// intersections.push(entity);
/// true
Expand Down Expand Up @@ -745,7 +745,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// &Collider::sphere(0.5), // Shape
/// Vec3::ZERO, // Shape position
/// Quat::default(), // Shape rotation
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// );
///
/// for entity in intersections.iter() {
Expand Down Expand Up @@ -793,7 +793,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// &Collider::sphere(0.5), // Shape
/// Vec3::ZERO, // Shape position
/// Quat::default(), // Shape rotation
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |entity| { // Callback function
/// intersections.push(entity);
/// true
Expand Down