pub fn calculate_bounds_2d(
    commands: Commands<'_, '_>,
    meshes: Res<'_, Assets<Mesh>>,
    images: Res<'_, Assets<Image>>,
    atlases: Res<'_, Assets<TextureAtlas>>,
    meshes_without_aabb: Query<'_, '_, (Entity, &Mesh2dHandle), (Without<Aabb>, Without<NoFrustumCulling>)>,
    sprites_without_aabb: Query<'_, '_, (Entity, &Sprite, &Handle<Image>), (Without<Aabb>, Without<NoFrustumCulling>)>,
    atlases_without_aabb: Query<'_, '_, (Entity, &TextureAtlasSprite, &Handle<TextureAtlas>), (Without<Aabb>, Without<NoFrustumCulling>)>
Expand description

System calculating and inserting an Aabb component to entities with either:

  • a Mesh2dHandle component,
  • a Sprite and Handle<Image> components,
  • a TextureAtlasSprite and Handle<TextureAtlas> components, and without a NoFrustumCulling component.

Used in system set VisibilitySystems::CalculateBounds.