Module bevy::ecs::archetype

Expand description

Types for defining Archetypes, collections of entities that have the same set of components.

An archetype uniquely describes a group of entities that share the same components: a world only has one archetype for each unique combination of components, and all entities that have those components and only those components belong to that archetype.

Archetypes are not to be confused with Tables. Each archetype stores its table components in one table, and each archetype uniquely points to one table, but multiple archetypes may store their table components in the same table. These archetypes differ only by the SparseSet components.

Like tables, archetypes can be created but are never cleaned up. Empty archetypes are not removed, and persist until the world is dropped.

Archetypes can be fetched from Archetypes, which is accessible via World::archetypes.