Skip to content

Iterate ALL Entities in world (get EntityRef/EntityMut) #5504

Closed
@Moulberry

Description

@Moulberry

What problem does this solve or what need does it fill?

There are cases where direct access to EntityRef/EntityMut is needed in an iterating context

What solution would you like?

An archetype-based solution, ideally we could have a &EntityRef or &mut EntityMut in queries, which would automatically imply exclusive world access thinking. (#5496 (comment))

What alternative(s) have you considered?

Iterating Entity (the ID) and calling World::entity. This solution works, but it is unintuitive and suffers from worse performance than a built-in solution for iterating EntityRef/EntityMut

Additional context

Original discussion: #5496

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions