pub fn calculate_bounds_2d(
commands: Commands<'_, '_>,
meshes: Res<'_, Assets<Mesh>>,
images: Res<'_, Assets<Image>>,
atlases: Res<'_, Assets<TextureAtlasLayout>>,
meshes_without_aabb: Query<'_, '_, (Entity, &Mesh2d), (Without<Aabb>, Without<NoFrustumCulling>)>,
sprites_to_recalculate_aabb: Query<'_, '_, (Entity, &Sprite, &Anchor), (Or<(Without<Aabb>, Changed<Sprite>, Changed<Anchor>)>, Without<NoFrustumCulling>)>,
)
Expand description
System calculating and inserting an Aabb
component to entities with either:
- a
Mesh2d
component, - a
Sprite
andHandle<Image>
components, and without aNoFrustumCulling
component.
Used in system set VisibilitySystems::CalculateBounds
.