pub struct Hierarchy<P> { /* private fields */ }
Expand description

Scene graph type hierarchy.

Will use the given generic type P as the component type that provides parenting links. The internal structure is kept in sync with the Tracked events for that component type.

Will send modification events on the internal EventChannel. Note that Removed events do not indicate that the Parent component was removed from the component storage, just that the Entity will no longer be considered to be a part of the Hierarchy. This is because the user may wish to either remove only the component, or the complete Entity, or something completely different. When an Entity that is a parent gets removed from the hierarchy, the full tree of children below it will also be removed from the hierarchy.

Any cycles in the hierarchy will cause Undefined Behavior.

Implementations

Create a new hierarchy object.

Get all entities that contain parents, in sorted order, where parents are guaranteed to be before their children.

Note: This does not include entities that are parents.

Get the immediate children of a specific entity.

Get all children of this entity recursively as a BitSet

This does not include the parent entity you pass in.

Returns an iterator over all of the recursive children of this entity.

This does not include the parent entity you pass in. Parents are guaranteed to be prior to their children.

Get the parent of a specific entity

Get a token for tracking the modification events from the hierarchy

Get the EventChannel for the modification events for reading

Maintain the hierarchy, usually only called by HierarchySystem.

Trait Implementations

Sets up Resources for fetching T.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.