From 8faa3c850bcc05fc020876e6e98c42fa5258a669 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Sat, 4 Nov 2023 15:43:59 +0000 Subject: [PATCH] Replace ComputedVisibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … according to https://github.com/bevyengine/bevy/pull/9497 --- src/immediate.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/immediate.rs b/src/immediate.rs index 58124e1..0e422e0 100644 --- a/src/immediate.rs +++ b/src/immediate.rs @@ -148,7 +148,8 @@ pub struct Raycast<'w, 's> { 'w, 's, ( - Read, + Read, + Read, Read, Read, Entity, @@ -232,13 +233,12 @@ impl<'w, 's> Raycast<'w, 's> { // of entities that are in the path of the ray. let (aabb_hits_tx, aabb_hits_rx) = crossbeam_channel::unbounded::<(FloatOrd, Entity)>(); let visibility_setting = settings.visibility; - self.culling_query - .par_iter() - .for_each(|(visibility, aabb, transform, entity)| { + self.culling_query.par_iter().for_each( + |(inherited_visibility, view_visibility, aabb, transform, entity)| { let should_raycast = match visibility_setting { RaycastVisibility::Ignore => true, - RaycastVisibility::MustBeVisible => visibility.is_visible_in_hierarchy(), - RaycastVisibility::MustBeVisibleAndInView => visibility.is_visible_in_view(), + RaycastVisibility::MustBeVisible => inherited_visibility.get(), + RaycastVisibility::MustBeVisibleAndInView => view_visibility.get(), }; if should_raycast { if let Some([near, _]) = ray @@ -248,7 +248,8 @@ impl<'w, 's> Raycast<'w, 's> { aabb_hits_tx.send((FloatOrd(near), entity)).ok(); } } - }); + }, + ); *self.culled_list = aabb_hits_rx.try_iter().collect(); self.culled_list.sort_by_key(|(aabb_near, _)| *aabb_near); drop(ray_cull_guard);