calculate_bounds_2d

Function calculate_bounds_2d 

Source
pub fn calculate_bounds_2d(
    commands: Commands<'_, '_>,
    meshes: Res<'_, Assets<Mesh>>,
    images: Res<'_, Assets<Image>>,
    atlases: Res<'_, Assets<TextureAtlasLayout>>,
    new_mesh_aabb: Query<'_, '_, (Entity, &Mesh2d), (Without<Aabb>, Without<NoFrustumCulling>, Without<NoAutoAabb>)>,
    update_mesh_aabb: Query<'_, '_, (&Mesh2d, &mut Aabb), (Or<(AssetChanged<Mesh2d>, Changed<Mesh2d>)>, Without<NoFrustumCulling>, Without<NoAutoAabb>, Without<Sprite>)>,
    new_sprite_aabb: Query<'_, '_, (Entity, &Sprite, &Anchor), (Without<Aabb>, Without<NoFrustumCulling>, Without<NoAutoAabb>)>,
    update_sprite_aabb: Query<'_, '_, (&Sprite, &mut Aabb, &Anchor), (Or<(Changed<Sprite>, Changed<Anchor>)>, Without<NoFrustumCulling>, Without<NoAutoAabb>, Without<Mesh2d>)>,
)
Expand description

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

  • a Mesh2d component,
  • a Sprite and Handle<Image> components, and without a NoFrustumCulling component.

Used in system set VisibilitySystems::CalculateBounds.