Expand description
Entity scopes: which entity an entity lives in, and the tree that makes.
An entity’s scope is another entity, not a separate identifier space, so the
relation between entities is a tree of handles. The tree that results is what
a Scope sees through: a scope of a scope sees that scope’s
whole subtree.
The tree is the one copy of the relation. It is kept here rather than in a component because visibility is decided on every access, and a component would have to be borrowed to answer it: a caller holding a component of one entity must not make the visibility check of another entity depend on what is borrowed. Only the world writes the tree, so the recorded parent and the archetype’s per-scope row counts have one writer rather than several.
Two entities are special: the root owns the world, and the shared scope’s subtree is visible to every scope.
Re-exports§
use crate::entity::Entity;🔒use crate::error::EntityAccessError;🔒use crate::hash::EntityHashMap;🔒
Structs§
- Scope
Tree 🔒 - The parent and child links of every live entity.