Skip to content

Commit

Permalink
Allow ray and shape casting for entities with colliders
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Jul 8, 2023
1 parent 0f6e289 commit 6b6c70d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/plugins/spatial_query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,7 @@ fn update_shape_caster_positions(
}
}

fn raycast(
mut rays: Query<(&RayCaster, &mut RayHits), Without<Collider>>,
spatial_query: SpatialQuery,
) {
fn raycast(mut rays: Query<(&RayCaster, &mut RayHits)>, spatial_query: SpatialQuery) {
let colliders = spatial_query.get_collider_hash_map();
for (ray, mut hits) in &mut rays {
if ray.enabled {
Expand All @@ -348,10 +345,7 @@ fn raycast(
}
}

fn shapecast(
mut shape_casters: Query<(&ShapeCaster, &mut ShapeHit), Without<Collider>>,
spatial_query: SpatialQuery,
) {
fn shapecast(mut shape_casters: Query<(&ShapeCaster, &mut ShapeHit)>, spatial_query: SpatialQuery) {
let colliders = spatial_query.get_collider_hash_map();
for (shape_caster, mut hit) in &mut shape_casters {
if shape_caster.enabled {
Expand Down

0 comments on commit 6b6c70d

Please sign in to comment.