![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MovieSceneEntityManager.h>
Inheritance diagram for UE::MovieScene::FEntityManager:Static Public Member Functions | |
| static MOVIESCENE_API IComponentTypeHandler * | FindComponentTypeHandler (const FGuid &ComponentGuid) |
Friends | |
| struct | FEntityInitializer |
| struct | FEntityAllocationProxy |
| struct | FEntityAllocationIterator |
| struct | FEntityAllocationIteratorProxy |
Top-level manager class that is responsible for all entity data and interaction/
An entity is a stable index into the manager's EntityLocations, which defines the location for that entity's data. This allows the manager to relocate entity data at will without invalidating client held entity IDs. An entity may contain 0 or more components. Components are concrete pieces of data with a unique type identifier. Additionally, tags can be added to entities or whole batches of entities with zero memory overhead.
Entity Component data is stored in allocations organized by each unique combination of components. Each component type is stored as a contiguous array within each allocation, with each entity's component being a fixed offset from the start of each component array. This enables efficient read/write access into specific component arrays and makes issuing parallel tasks that require component data trivial. See FEntityAllocation for a more detailed explanation of entity component data layout.
| UE::MovieScene::FEntityManager::FEntityManager | ( | ) |
| UE::MovieScene::FEntityManager::~FEntityManager | ( | ) |
|
delete |
|
delete |
| void UE::MovieScene::FEntityManager::AccumulateMask | ( | const FEntityComponentFilter & | InFilter, |
| FComponentMask & | OutMask | ||
| ) | const |
Accumulate a mask from all entity types that match the specified filter
| InFilter | The filter to match allocations against. Filter is copied into the iterator. |
| OutMask | The mask to receive the binary OR accumulation of all entities that pass the filter |
| void UE::MovieScene::FEntityManager::AddChild | ( | FMovieSceneEntityID | ParentID, |
| FMovieSceneEntityID | ChildID | ||
| ) |
Set up an entity to be a child of another. Child entities will only be cleaned up if their parents are marked Unlink, and TagOrphanedChildren is called
| ParentID | The ID of the parent |
| ChildID | The ID of the child |
| void UE::MovieScene::FEntityManager::AddComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID | ||
| ) |
Add the specified component type to an entity. The component value will be default-initialized.
| EntityID | The ID of the entity to add the component to |
| ComponentTypeID | The ID of the component type to add to the entity |
| void UE::MovieScene::FEntityManager::AddComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID, | ||
| EEntityRecursion | Recursion | ||
| ) |
|
inline |
Add the specified component value to an entity
| EntityID | The ID of the entity to add the component to |
| ComponentTypeID | The ID of the component type to add to the entity |
| InValue | The value of the component to add |
| void UE::MovieScene::FEntityManager::AddComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | EntityComponentMask | ||
| ) |
Add the specified components to an entity. Existing components will remain unchanged. New component values will be default-initialized.
| EntityID | The ID of the entity to add the components to |
| EntityComponentMask | A mask constituting the components that should be added (set bits indicate components to add) |
| void UE::MovieScene::FEntityManager::AddComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | EntityComponentMask, | ||
| EEntityRecursion | Recursion | ||
| ) |
| void UE::MovieScene::FEntityManager::AddMutualComponents | ( | ) |
Run through all entities in this entity manager, ensuring that all mutual components exist
| void UE::MovieScene::FEntityManager::AddMutualComponents | ( | const FEntityComponentFilter & | InFilter | ) |
Run through all entities in this entity manager, ensuring that all mutual components exist for any component types that match the specified filter
| void UE::MovieScene::FEntityManager::AddReferencedObjects | ( | FReferenceCollector & | ReferenceCollector | ) |
Explicitly add referenced objects from an external source. This is not called by default for the global entity manager because each entity owner should do so to avoid cyclic dependencies.
| FEntityDataLocation UE::MovieScene::FEntityManager::AllocateContiguousEntities | ( | const FComponentMask & | EntityComponentMask, |
| int32 * | InOutNum | ||
| ) |
Attempt to allocate a number of entities of the same type contiguously in memory
| EntityComponentMask | Defines the components that should exist on the allocated components. Set bits denote allocated components and tags. |
| InOutNum | A valid pointer to the desired number to allocate. Is overwritten with the number that were actually allocated. |
| FMovieSceneEntityID UE::MovieScene::FEntityManager::AllocateEntity | ( | ) |
Allocate a new entity with no components
| FEntityInfo UE::MovieScene::FEntityManager::AllocateEntity | ( | const FComponentMask & | EntityComponentMask | ) |
Allocate a single entity with the specified components
| EntityComponentMask | Defines the components that should exist on the allocated components. Set bits denote allocated components and tags. |
| void UE::MovieScene::FEntityManager::ChangeEntityType | ( | FMovieSceneEntityID | InEntity, |
| const FComponentMask & | InNewMask | ||
| ) |
Changes the components that exist on an entity to a new mask
| InEntity | The ID of the entity |
| InNewMask | The new mask of the entity that defines which components it should have |
|
inline |
| void UE::MovieScene::FEntityManager::CombineComponents | ( | FMovieSceneEntityID | DestinationEntityID, |
| FMovieSceneEntityID | SourceEntityID, | ||
| const FComponentMask * | OptionalMask = nullptr |
||
| ) |
Combine the components from one entity into another, overwriting any pre-existing component values. Does not free any entities.
| DestinationEntityID | The ID of the entity to add new components to |
| SourceEntityID | The ID of the entity to copy components from |
| OptionalMask | (Optional) A mask constituting the components that should be copied |
| void UE::MovieScene::FEntityManager::Compact | ( | ) |
Goes through all entity data and compacts like-for-like allocations into as few allocations as possible, resulting in the optimal data layout
| EEntityThreadingModel UE::MovieScene::FEntityManager::ComputeThreadingModel | ( | ) | const |
Compute and return this entity manager's threading model. Does not change the current cached threading model.
| bool UE::MovieScene::FEntityManager::Contains | ( | const FEntityComponentFilter & | InFilter | ) | const |
Efficiently test whether this entity manager contains any allocations that match the specified filter
| InFilter | The filter to match allocations against. |
|
inline |
Check whether all of the specified components exist anywhere in this entity manager
| ComponentTypeIDs | The types of the components that are being tested for |
|
inline |
Check whether any entity in this manager has any of the specified components
| ComponentTypeIDs | The types of the component that are being tested for |
|
inline |
Check whether any entity in this manager has any of the specified components
| ComponentTypeIDs | The types of the component that are being tested for |
|
inline |
Check whether any entity in this manager has the specified component
| ComponentTypeID | The type of the component that is being tested for |
| bool UE::MovieScene::FEntityManager::CopyComponent | ( | FMovieSceneEntityID | SrcEntityID, |
| FMovieSceneEntityID | DstEntityID, | ||
| FComponentTypeID | ComponentTypeID | ||
| ) |
Copy the specified component type from an entity if it exists.
| SrcEntityID | The ID of the entity to copy from |
| DstEntityID | The ID of the entity to copy to |
| ComponentTypeID | The ID of the component type to copy. Must exist on SrcEntityID |
| void UE::MovieScene::FEntityManager::CopyComponents | ( | FMovieSceneEntityID | SrcEntityID, |
| FMovieSceneEntityID | DstEntityID, | ||
| const FComponentMask & | ComponentsToCopy | ||
| ) |
Copy any and all the specified component types from one entity onto another. Missing components on the source entity are handled gracefully.
| SrcEntityID | The ID of the entity to copy from |
| DstEntityID | The ID of the entity to copy to |
| ComponentsToCopy | A mask constituting the components that should be copied (set bits indicate components to copy) |
| MOVIESCENE_API void UE::MovieScene::FEntityManager::CountMemory | ( | FArchive & | Ar, |
| FMovieSceneEntityID | EntityID | ||
| ) |
Run a serialization routine over the specified entity to approximate the memory it is using
| Ar | The archive to save to. Ar.IsCountingMemory() must be true. |
| EntityID | Identifier for the entity to replace object references within |
|
inline |
Defines a new child initializer that applies only to entities factoried within this entity manager
| InInitializer | The initializer to insert |
| void UE::MovieScene::FEntityManager::Destroy | ( | ) |
Destroy this entity manager and all the entities and components contained within it, resetting it back to its default state
Destroy a previously registered instanced child initializer using its index
| FMovieSceneEntityID UE::MovieScene::FEntityManager::DuplicateEntity | ( | FMovieSceneEntityID | InOther | ) |
Duplicate an entity, by creating an exact copy with a new ID
| InOther | The ID of the entity to duplicate |
| void UE::MovieScene::FEntityManager::EnterIteration | ( | ) | const |
Efficiently test whether this entity manager contains any allocations that match the specified filter
| InFilter | The filter to match allocations against. |
| void UE::MovieScene::FEntityManager::ExitIteration | ( | ) | const |
| void UE::MovieScene::FEntityManager::FilterComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | EntitiesToKeep | ||
| ) |
Remove all but the specified components from an entity.
| EntityID | The ID of the entity to remove the components from |
| EntitiesToKeep | A mask constituting the components that should be kept on the entity |
|
static |
Find a component type hander from its registered GUID
| int32 UE::MovieScene::FEntityManager::FreeEntities | ( | const FEntityComponentFilter & | Filter, |
| TSet< FMovieSceneEntityID > * | OutFreedEntities = nullptr |
||
| ) |
Free all entities that match the specified filter
| Filter | A filter that defines the entities to free. Any entity that passes the filter will be destroyed. |
| OutFreedEntities | (Optional) A set to populate with all the entities that were freed (including any children) |
| int32 UE::MovieScene::FEntityManager::FreeEntities | ( | const FFreeEntityOperation & | Operation, |
| TSet< FMovieSceneEntityID > * | OutFreedEntities = nullptr |
||
| ) |
Free all entities defined by the specified operation
| Operation | A pre-populated free entity operation definition |
| OutFreedEntities | (Optional) A set to populate with all the entities that were freed (including any children) |
| void UE::MovieScene::FEntityManager::FreeEntity | ( | FMovieSceneEntityID | EntityID | ) |
Free an entity and relinquish its entity ID
| EntityID | A valid entity ID to free |
| const FComponentMask & UE::MovieScene::FEntityManager::GetAccumulatedMask | ( | ) | const |
Retrieve an up-to-date accumulation of all components present on entities in this manager
| void UE::MovieScene::FEntityManager::GetChildren_ParentFirst | ( | FMovieSceneEntityID | ParentID, |
| TArray< FMovieSceneEntityID > & | OutChildren | ||
| ) | const |
Retrieve all children, grandchildren etc of the specified entity using a parent first traversal
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
|
inline |
|
inline |
| FEntityInfo UE::MovieScene::FEntityManager::GetEntity | ( | FMovieSceneEntityID | EntityID | ) | const |
Retrieve an entity's allocation and component offset from its ID
| FEntityHandle UE::MovieScene::FEntityManager::GetEntityHandle | ( | FMovieSceneEntityID | EntityID | ) |
Retrieve a handle to an entity
| const FComponentMask & UE::MovieScene::FEntityManager::GetEntityType | ( | FMovieSceneEntityID | InEntity | ) | const |
Retrieve the type mask for this component
| InEntity | The ID of the entity |
|
inline |
|
inline |
Retrieve the entity filter that should be used for any entity iteration. Can be used to constrain all iterations to specific types
|
inline |
| void UE::MovieScene::FEntityManager::GetImmediateChildren | ( | FMovieSceneEntityID | ParentID, |
| TArray< FMovieSceneEntityID > & | OutChildren | ||
| ) | const |
Retrieve the immediate children of the specified entity
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
|
inline |
Get the current serial number for any system ovserving this entity manager. This serial number acts as a timestamp for the current state of this entity manager - any serial number more recent than this dictates more recent logic or state.
| EEntityThreadingModel UE::MovieScene::FEntityManager::GetThreadingModel | ( | ) | const |
Get this entitiy manager's current threading model based on the last time UpdateThreadingModel was called.
| bool UE::MovieScene::FEntityManager::HasComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID | ||
| ) | const |
Check whether the specified component has a component of the specified type
| EntityID | The ID of the entity to check |
| ComponentTypeID | The type of the component that is being tested for |
Check whether the structure of this entity manager has changed at all since the specified serial number
Increment the current serial number for systems observing this manager. Should be called after any system is run
| void UE::MovieScene::FEntityManager::InitializeChildAllocation | ( | const FComponentMask & | ParentType, |
| const FComponentMask & | ChildType, | ||
| const FEntityAllocation * | ParentAllocation, | ||
| TArrayView< const int32 > | ParentAllocationOffsets, | ||
| const FEntityRange & | InChildEntityRange | ||
| ) |
Runs all initializers for the specified parent/child allocation
|
inline |
Check whether an entity is allocated.
| bool UE::MovieScene::FEntityManager::IsHandleValid | ( | FEntityHandle | EntityID | ) | const |
Check whether the specified entity handle is still valid
|
inline |
| FEntityAllocationIteratorProxy UE::MovieScene::FEntityManager::Iterate | ( | const FEntityComponentFilter * | InFilter | ) | const |
Iterate through all the allocations that match the specified component filter
| InFilter | (required, non-null) The filter to match allocations against. Filter is copied into the iterator. |
|
inline |
Iterate all children, grandchildren etc of the specified entity using a parent first traversal
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
|
inline |
Itereate the immediate children of the specified entity
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
|
inline |
|
inline |
Called in order to mimic the entity structure changing, even if it has not
|
inline |
Modify the entity filter that should be used for any entity iteration.
| int32 UE::MovieScene::FEntityManager::MutateAll | ( | const FEntityComponentFilter & | Filter, |
| const IMovieSceneEntityMutation & | Mutation, | ||
| EMutuallyInclusiveComponentType | MutualTypes = EMutuallyInclusiveComponentType::Mandatory |
||
| ) |
Efficiently mutate all entities that match a filter. Mutations can add or remove components from batches of entity data.
| Filter | The filter to match entity allocations against. Only entities that match the filter will be mutated |
| Mutation | Implementation that defines how to mutate the entities that match the filter |
| int32 UE::MovieScene::FEntityManager::MutateConditional | ( | const FEntityComponentFilter & | Filter, |
| const IMovieSceneConditionalEntityMutation & | Mutation, | ||
| EMutuallyInclusiveComponentType | MutualTypes = EMutuallyInclusiveComponentType::Mandatory |
||
| ) |
Efficiently mutate all entities that match a filter. Mutations can add or remove components from batches of entity data.
| Filter | The filter to match entity allocations against. Only entities that match the filter will be mutated |
| Mutation | Implementation that defines how to mutate the entities that match the filter |
|
delete |
|
delete |
| void UE::MovieScene::FEntityManager::OverwriteEntityWithDuplicate | ( | FMovieSceneEntityID & | InOutEntity, |
| FMovieSceneEntityID | InEntityToDuplicate | ||
| ) |
Duplicate an entity over the top of an existing entity ID
| InOutEntity | The ID of the entity to overwrite. Doesn't have to be valid. |
| InEntityToDuplicate | The ID of the entity to duplicate |
|
inline |
Attempt to read a component from an entity.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
|
inline |
Read a component value from an entity that is known to exist.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
|
inline |
| void UE::MovieScene::FEntityManager::RemoveComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID | ||
| ) |
Remove the specified component type from an entity if it exists.
| EntityID | The ID of the entity to remove the component from |
| ComponentTypeID | The ID of the component type to remove from the entity |
| void UE::MovieScene::FEntityManager::RemoveComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID, | ||
| EEntityRecursion | Recursion | ||
| ) |
| void UE::MovieScene::FEntityManager::RemoveComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | ComponentsToRemove | ||
| ) |
Remove the specified components from an entity, if they exist.
| EntityID | The ID of the entity to remove the components from |
| ComponentsToRemove | A mask constituting the components that should be removed (set bits indicate components to add) |
| void UE::MovieScene::FEntityManager::RemoveComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | ComponentsToRemove, | ||
| EEntityRecursion | Recursion | ||
| ) |
| void UE::MovieScene::FEntityManager::ReplaceEntityID | ( | FMovieSceneEntityID & | InOutEntity, |
| FMovieSceneEntityID | EntityToDiscard | ||
| ) |
Replace an entity ID with the components from another, discarding the provided entity ID in the process
| InOutEntity | The entity ID to be reassigned. If it is already valid, the existing entity will be freed |
| EntityToDiscard | The entity containing the components to replace InOutEntity with. This Entity ID will be invalid after this function call. |
|
inline |
|
inline |
Set a debug name for this entity manager
|
inline |
|
inline |
| void UE::MovieScene::FEntityManager::TouchEntity | ( | FMovieSceneEntityID | EntityID | ) |
Touch the specified entity, cause the allocation and component serial numbers to be incremented. Will invalidate any transient caches maintained for serial such numbers.
| EntityID | The ID of the entity to touch. |
| void UE::MovieScene::FEntityManager::UpdateThreadingModel | ( | ) |
Compute and store the current threading model.
|
inline |
Attempt to write to an entity's component.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
|
inline |
Write a component value that is known to exist to an entity.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
| Value | The value to write |
|
friend |
|
friend |