Skip to content

Commit a1853b7

Browse files
fix docs (#638)
# 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.
1 parent acae639 commit a1853b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/spatial_query/pipeline.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl SpatialQueryPipeline {
186186
/// - `max_distance`: The maximum distance the ray can travel.
187187
/// - `solid`: If true *and* the ray origin is inside of a collider, the hit point will be the ray origin itself.
188188
/// 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`.
190190
/// - `filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
191191
///
192192
/// # Related Methods
@@ -370,7 +370,7 @@ impl SpatialQueryPipeline {
370370
/// - `direction`: What direction the shape is cast in.
371371
/// - `config`: A [`ShapeCastConfig`] that determines the behavior of the cast.
372372
/// - `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`.
374374
///
375375
/// # Related Methods
376376
///
@@ -592,7 +592,7 @@ impl SpatialQueryPipeline {
592592
/// - `solid`: If true and the point is inside of a collider, the projection will be at the point.
593593
/// Otherwise, the collider will be treated as hollow, and the projection will be at the collider's boundary.
594594
/// - `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`
596596
///
597597
/// # Related Methods
598598
///

0 commit comments

Comments
 (0)