Skip to main content

cull_offscreen

Function cull_offscreen 

Source
pub fn cull_offscreen(
    commands: Commands<'_, '_>,
    viewport: Res<'_, Viewport>,
    rects: Query<'_, '_, (Entity, &ExtractedRect)>,
    texts: Query<'_, '_, (Entity, &ExtractedText)>,
)
Expand description

Despawns extracted entities whose AABB lies fully outside the Viewport.

  • Runs in RenderStage::Prepare (registered automatically by App::new).
  • Performs only an AABB test against the viewport; partial-overlap clipping is the renderer’s responsibility.