You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
The docs say that the ray/shape casts will stop on the first instance where the predicate returns false, but it seems like the opposite is the case.
Maybe it would be good to add a unit test to confirm this.
Copy file name to clipboardExpand all lines: src/spatial_query/pipeline.rs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ impl SpatialQueryPipeline {
186
186
/// - `max_distance`: The maximum distance the ray can travel.
187
187
/// - `solid`: If true *and* the ray origin is inside of a collider, the hit point will be the ray origin itself.
188
188
/// Otherwise, the collider will be treated as hollow, and the hit point will be at its boundary.
189
-
/// - `predicate`: A function called on each entity hit by the ray. The ray keeps travelling until the predicate returns `false`.
189
+
/// - `predicate`: A function called on each entity hit by the ray. The ray keeps travelling until the predicate returns `true`.
190
190
/// - `filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
191
191
///
192
192
/// # Related Methods
@@ -370,7 +370,7 @@ impl SpatialQueryPipeline {
370
370
/// - `direction`: What direction the shape is cast in.
371
371
/// - `config`: A [`ShapeCastConfig`] that determines the behavior of the cast.
372
372
/// - `filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
373
-
/// - `predicate`: A function called on each entity hit by the shape. The shape keeps travelling until the predicate returns `false`.
373
+
/// - `predicate`: A function called on each entity hit by the shape. The shape keeps travelling until the predicate returns `true`.
374
374
///
375
375
/// # Related Methods
376
376
///
@@ -592,7 +592,7 @@ impl SpatialQueryPipeline {
592
592
/// - `solid`: If true and the point is inside of a collider, the projection will be at the point.
593
593
/// Otherwise, the collider will be treated as hollow, and the projection will be at the collider's boundary.
594
594
/// - `filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
595
-
/// - `predicate`: A function for filtering which entities are considered in the query. The projection will be on the closest collider that passes the predicate.
595
+
/// - `predicate`: A function for filtering which entities are considered in the query. The projection will be on the closest collider for which the `predicate` returns `true`
0 commit comments