Skip to main content

Module entity

Module entity 

Source
Expand description

Entity identifiers and their allocator.

An Entity is an index plus a generation. Despawning bumps the generation, so a handle to a dead entity never resolves to a new entity that happened to reuse the index.

A handle also carries a name, so that a message names the object it is about rather than a bare number. Debug prints it. The name is only a label: it takes no part in comparison, hashing or Entity::to_bits.

Where the name comes from is decided where the entity is made. A crate::bundle! names the entity after its own source position, crate::DynamicBundle::named and crate::ScopeMut::spawn_named name it after the string the caller passed, and crate::World::reserve_entity names it at the reservation. A builder put together at run time by hand carries no source position, so an entity spawned from one is called by whatever the caller named it.

Re-exports§

use crate::error::EntityAccessError; 🔒

Structs§

Entities 🔒
Allocates entity handles and maps them to their row in an archetype.
Entity
A handle to an entity.
EntityProxyreflect
An Entity as its Entity::to_bits integer.
EntityVecProxyreflect
A list of Entity handles, each as its Entity::to_bits integer.
Location
Where an entity’s components live.
Meta 🔒