Function bevy::render::view::check_visibility

pub fn check_visibility<QF>(
    thread_queues: Local<'_, Parallel<Vec<Entity>>>,
    view_query: Query<'_, '_, (Entity, &mut VisibleEntities, &Frustum, Option<&RenderLayers>, &Camera, Has<NoCpuCulling>)>,
    visible_aabb_query: Query<'_, '_, (Entity, &InheritedVisibility, &mut ViewVisibility, Option<&RenderLayers>, Option<&Aabb>, &GlobalTransform, Has<NoFrustumCulling>, Has<VisibilityRange>), QF>,
    visible_entity_ranges: Option<Res<'_, VisibleEntityRanges>>
)
where QF: QueryFilter + 'static,
Expand description

System updating the visibility of entities each frame.

The system is part of the VisibilitySystems::CheckVisibility set. Each frame, it updates the ViewVisibility of all entities, and for each view also compute the VisibleEntities for that view.

This system needs to be run for each type of renderable entity. If you add a new type of renderable entity, you’ll need to add an instantiation of this system to the VisibilitySystems::CheckVisibility set so that Bevy will detect visibility properly for those entities.