Navigation
API > API/Runtime > API/Runtime/MovieScene
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.
| Name | FEntityManager |
| Type | class |
| Header File | /Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntityManager.h |
| Include Path | #include "EntitySystem/MovieSceneEntityManager.h" |
Syntax
class FEntityManager : public FUObjectArray::FUObjectDeleteListener
Inheritance Hierarchy
- FUObjectArray::FUObjectDeleteListener → FEntityManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FEntityManager
(
const FEntityManager& |
EntitySystem/MovieSceneEntityManager.h | ||
FEntityManager
(
FEntityManager&& |
EntitySystem/MovieSceneEntityManager.h | ||
| EntitySystem/MovieSceneEntityManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FEntityManager() |
EntitySystem/MovieSceneEntityManager.h |
Structs
| Name | Remarks |
|---|---|
| FEntityLocation |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AccumulatedMask | FComponentMask | EntitySystem/MovieSceneEntityManager.h | ||
| AllocationsWithCapacity | TBitArray | Bit mask of allocations that currently have capacity | EntitySystem/MovieSceneEntityManager.h | |
| bAccumulatedMaskStale | bool | EntitySystem/MovieSceneEntityManager.h | ||
| bHandleGenerationStale | bool | EntitySystem/MovieSceneEntityManager.h | ||
| ComponentRegistry | FComponentRegistry * | EntitySystem/MovieSceneEntityManager.h | ||
| CurrentHandleGeneration | uint32 | The current generation of entities - incremented any time an entity is destroyed | EntitySystem/MovieSceneEntityManager.h | |
| DispatchThread | ENamedThreads::Type | EntitySystem/MovieSceneEntityManager.h | ||
| EntityAllocationMasks | TSparseArray< FComponentMask > | Sparse array of masks that define each index within EntityAllocations' component types | EntitySystem/MovieSceneEntityManager.h | |
| EntityAllocations | TSparseArray< FEntityAllocation * > | Sparse array of entity allocation pointers. Allocations are heap allocated. | EntitySystem/MovieSceneEntityManager.h | |
| EntityGenerationMap | TMap< FMovieSceneEntityID, uint32 > | Map of entity ID to the generation its handle was created in. | EntitySystem/MovieSceneEntityManager.h | |
| EntityLocations | TSparseArray< FEntityLocation > | Sparse array of entity location information for each allocated entity ID. | EntitySystem/MovieSceneEntityManager.h | |
| FFreeEntityOperation | friend | EntitySystem/MovieSceneEntityManager.h | ||
| GatherThread | ENamedThreads::Type | EntitySystem/MovieSceneEntityManager.h | ||
| GlobalIterationFilter | FEntityComponentFilter | EntitySystem/MovieSceneEntityManager.h | ||
| InstancedChildInitializers | TSparseArray< TInlineValue< FChildEntityInitializer > > | EntitySystem/MovieSceneEntityManager.h | ||
| IterationCount | FEntitySystemMaybeAtomicInt32 | Atomic counter that is incremented when an iteration begins, and decremented when it finishes | EntitySystem/MovieSceneEntityManager.h | |
| LockdownState | ELockdownState | EntitySystem/MovieSceneEntityManager.h | ||
| ManagerDebugName | FString | Debug name for this entity manager | EntitySystem/MovieSceneEntityManager.h | |
| NextAllocationID | uint32 | Serially incrementing unique identifier that is assigned to each new entity allocation that is created | EntitySystem/MovieSceneEntityManager.h | |
| ParentToChild | TMultiMap< FMovieSceneEntityID, FMovieSceneEntityID > | Map of parent -> child entities | EntitySystem/MovieSceneEntityManager.h | |
| RichComponentDebuggingPtr | const bool * | Debugging ptr for natvis | EntitySystem/MovieSceneEntityManager.h | |
| StructureMutationSystemSerialNumber | uint64 | The value of this manager's SystemSerialNumber the last time any entities were allocated, freed, or mutated in some way (this does not include component values being written to) | EntitySystem/MovieSceneEntityManager.h | |
| SystemSerialNumber | uint64 | System serial number incremented for every run of any system | EntitySystem/MovieSceneEntityManager.h | |
| ThreadingModel | EEntityThreadingModel | EntitySystem/MovieSceneEntityManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AccumulateMask
(
const FEntityComponentFilter& InFilter, |
Accumulate a mask from all entity types that match the specified filter | EntitySystem/MovieSceneEntityManager.h | |
void AddChild
(
FMovieSceneEntityID ParentID, |
Set up an entity to be a child of another. | EntitySystem/MovieSceneEntityManager.h | |
void AddComponent
(
FMovieSceneEntityID EntityID, |
EntitySystem/MovieSceneEntityManager.h | ||
void AddComponent
(
FMovieSceneEntityID EntityID, |
Add the specified component value to an entity | EntitySystem/MovieSceneEntityManager.h | |
void AddComponent
(
FMovieSceneEntityID EntityID, |
Add the specified component type to an entity. The component value will be default-initialized. | EntitySystem/MovieSceneEntityManager.h | |
void AddComponents
(
FMovieSceneEntityID EntityID, |
Add the specified components to an entity. | EntitySystem/MovieSceneEntityManager.h | |
void AddComponents
(
FMovieSceneEntityID EntityID, |
EntitySystem/MovieSceneEntityManager.h | ||
void AddMutualComponents () |
Run through all entities in this entity manager, ensuring that all mutual components exist | EntitySystem/MovieSceneEntityManager.h | |
void 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 | EntitySystem/MovieSceneEntityManager.h | |
void AddReferencedObjects
(
FReferenceCollector& ReferenceCollector |
Explicitly add referenced objects from an external source. | EntitySystem/MovieSceneEntityManager.h | |
FEntityDataLocation AllocateContiguousEntities
(
const FComponentMask& EntityComponentMask, |
Attempt to allocate a number of entities of the same type contiguously in memory | EntitySystem/MovieSceneEntityManager.h | |
| Allocate a new entity with no components | EntitySystem/MovieSceneEntityManager.h | ||
FEntityInfo AllocateEntity
(
const FComponentMask& EntityComponentMask |
Allocate a single entity with the specified components | EntitySystem/MovieSceneEntityManager.h | |
void ChangeEntityType
(
FMovieSceneEntityID InEntity, |
Changes the components that exist on an entity to a new mask | EntitySystem/MovieSceneEntityManager.h | |
void CheckCanChangeStructure() |
EntitySystem/MovieSceneEntityManager.h | ||
void CombineComponents
(
FMovieSceneEntityID DestinationEntityID, |
Combine the components from one entity into another, overwriting any pre-existing component values. | EntitySystem/MovieSceneEntityManager.h | |
void Compact() |
Goes through all entity data and compacts like-for-like allocations into as few allocations as possible, resulting in the optimal data layout | EntitySystem/MovieSceneEntityManager.h | |
| Compute and return this entity manager's threading model. | EntitySystem/MovieSceneEntityManager.h | ||
bool Contains
(
const FEntityComponentFilter& InFilter |
Efficiently test whether this entity manager contains any allocations that match the specified filter | EntitySystem/MovieSceneEntityManager.h | |
bool ContainsAllComponents
(
std::initializer_list< FComponentTypeID > ComponentTypeIDs |
Check whether all of the specified components exist anywhere in this entity manager | EntitySystem/MovieSceneEntityManager.h | |
bool ContainsAnyComponent
(
const FComponentMask& ComponentTypeIDs |
Check whether any entity in this manager has any of the specified components | EntitySystem/MovieSceneEntityManager.h | |
bool ContainsAnyComponent
(
std::initializer_list< FComponentTypeID > ComponentTypeIDs |
Check whether any entity in this manager has any of the specified components | EntitySystem/MovieSceneEntityManager.h | |
bool ContainsComponent
(
FComponentTypeID ComponentTypeID |
Check whether any entity in this manager has the specified component | EntitySystem/MovieSceneEntityManager.h | |
bool CopyComponent
(
FMovieSceneEntityID SrcEntityID, |
Copy the specified component type from an entity if it exists. | EntitySystem/MovieSceneEntityManager.h | |
void CopyComponents
(
FMovieSceneEntityID SrcEntityID, |
Copy any and all the specified component types from one entity onto another. | EntitySystem/MovieSceneEntityManager.h | |
void CountMemory
(
FArchive& Ar, |
Run a serialization routine over the specified entity to approximate the memory it is using | EntitySystem/MovieSceneEntityManager.h | |
int32 DefineInstancedChildInitializer
(
TInlineValue< FChildEntityInitializer >&& InInitializer |
Defines a new child initializer that applies only to entities factoried within this entity manager | EntitySystem/MovieSceneEntityManager.h | |
void Destroy() |
Destroy this entity manager and all the entities and components contained within it, resetting it back to its default state | EntitySystem/MovieSceneEntityManager.h | |
void DestroyInstancedChildInitializer
(
int32 Index |
Destroy a previously registered instanced child initializer using its index | EntitySystem/MovieSceneEntityManager.h | |
FMovieSceneEntityID DuplicateEntity
(
FMovieSceneEntityID InOther |
Duplicate an entity, by creating an exact copy with a new ID | EntitySystem/MovieSceneEntityManager.h | |
void EnterIteration() |
Efficiently test whether this entity manager contains any allocations that match the specified filter | EntitySystem/MovieSceneEntityManager.h | |
void ExitIteration() |
EntitySystem/MovieSceneEntityManager.h | ||
void FilterComponents
(
FMovieSceneEntityID EntityID, |
Remove all but the specified components from an entity. | EntitySystem/MovieSceneEntityManager.h | |
int32 FreeEntities
(
const FEntityComponentFilter& Filter, |
Free all entities that match the specified filter | EntitySystem/MovieSceneEntityManager.h | |
int32 FreeEntities
(
const FFreeEntityOperation& Operation, |
Free all entities defined by the specified operation | EntitySystem/MovieSceneEntityManager.h | |
void FreeEntity
(
FMovieSceneEntityID EntityID |
Free an entity and relinquish its entity ID | EntitySystem/MovieSceneEntityManager.h | |
const FComponentMask & GetAccumulatedMask() |
Retrieve an up-to-date accumulation of all components present on entities in this manager | EntitySystem/MovieSceneEntityManager.h | |
void GetChildren_ParentFirst
(
FMovieSceneEntityID ParentID, |
Retrieve all children, grandchildren etc of the specified entity using a parent first traversal | EntitySystem/MovieSceneEntityManager.h | |
FComponentRegistry * GetComponents() |
EntitySystem/MovieSceneEntityManager.h | ||
ENamedThreads::Type GetDispatchThread() |
EntitySystem/MovieSceneEntityManager.h | ||
FEntityInfo GetEntity
(
FMovieSceneEntityID EntityID |
Retrieve an entity's allocation and component offset from its ID | EntitySystem/MovieSceneEntityManager.h | |
FEntityHandle GetEntityHandle
(
FMovieSceneEntityID EntityID |
Retrieve a handle to an entity | EntitySystem/MovieSceneEntityManager.h | |
const FComponentMask & GetEntityType
(
FMovieSceneEntityID InEntity |
Retrieve the type mask for this component | EntitySystem/MovieSceneEntityManager.h | |
ENamedThreads::Type GetGatherThread() |
EntitySystem/MovieSceneEntityManager.h | ||
const FEntityComponentFilter & GetGlobalIterationFilter () |
Retrieve the entity filter that should be used for any entity iteration. | EntitySystem/MovieSceneEntityManager.h | |
uint32 GetHandleGeneration() |
EntitySystem/MovieSceneEntityManager.h | ||
void GetImmediateChildren
(
FMovieSceneEntityID ParentID, |
Retrieve the immediate children of the specified entity | EntitySystem/MovieSceneEntityManager.h | |
uint64 GetSystemSerial () |
Get the current serial number for any system ovserving this entity manager. | EntitySystem/MovieSceneEntityManager.h | |
EEntityThreadingModel GetThreadingModel() |
Get this entitiy manager's current threading model based on the last time UpdateThreadingModel was called. | EntitySystem/MovieSceneEntityManager.h | |
bool HasComponent
(
FMovieSceneEntityID EntityID, |
Check whether the specified component has a component of the specified type | EntitySystem/MovieSceneEntityManager.h | |
bool HasStructureChangedSince
(
uint64 CachedSerial |
Check whether the structure of this entity manager has changed at all since the specified serial number | EntitySystem/MovieSceneEntityManager.h | |
void IncrementSystemSerial
(
uint64 IncAmount |
Increment the current serial number for systems observing this manager. | EntitySystem/MovieSceneEntityManager.h | |
void InitializeChildAllocation
(
const FComponentMask& ParentType, |
Runs all initializers for the specified parent/child allocation | EntitySystem/MovieSceneEntityManager.h | |
bool IsAllocated
(
FMovieSceneEntityID EntityID |
Check whether an entity is allocated. | EntitySystem/MovieSceneEntityManager.h | |
bool IsHandleValid
(
FEntityHandle EntityID |
Check whether the specified entity handle is still valid | EntitySystem/MovieSceneEntityManager.h | |
bool IsLockedDown() |
EntitySystem/MovieSceneEntityManager.h | ||
FEntityAllocationIteratorProxy Iterate
(
const FEntityComponentFilter* InFilter |
Iterate through all the allocations that match the specified component filter | EntitySystem/MovieSceneEntityManager.h | |
void IterateChildren_ParentFirst
(
FMovieSceneEntityID ParentID, |
Iterate all children, grandchildren etc of the specified entity using a parent first traversal | EntitySystem/MovieSceneEntityManager.h | |
void IterateImmediateChildren
(
FMovieSceneEntityID ParentID, |
Itereate the immediate children of the specified entity | EntitySystem/MovieSceneEntityManager.h | |
void LockDown() |
EntitySystem/MovieSceneEntityManager.h | ||
void MimicStructureChanged() |
Called in order to mimic the entity structure changing, even if it has not | EntitySystem/MovieSceneEntityManager.h | |
| Modify the entity filter that should be used for any entity iteration. | EntitySystem/MovieSceneEntityManager.h | ||
int32 MutateAll
(
const FEntityComponentFilter& Filter, |
Efficiently mutate all entities that match a filter. | EntitySystem/MovieSceneEntityManager.h | |
int32 MutateConditional
(
const FEntityComponentFilter& Filter, |
Efficiently mutate all entities that match a filter. | EntitySystem/MovieSceneEntityManager.h | |
void OverwriteEntityWithDuplicate
(
FMovieSceneEntityID& InOutEntity, |
Duplicate an entity over the top of an existing entity ID | EntitySystem/MovieSceneEntityManager.h | |
TComponentLock< TReadOptional< T > > ReadComponent
(
FMovieSceneEntityID Entity, |
Attempt to read a component from an entity. | EntitySystem/MovieSceneEntityManager.h | |
T ReadComponentChecked
(
FMovieSceneEntityID Entity, |
Read a component value from an entity that is known to exist. | EntitySystem/MovieSceneEntityManager.h | |
void ReleaseLockDown() |
EntitySystem/MovieSceneEntityManager.h | ||
void RemoveComponent
(
FMovieSceneEntityID EntityID, |
Remove the specified component type from an entity if it exists. | EntitySystem/MovieSceneEntityManager.h | |
void RemoveComponent
(
FMovieSceneEntityID EntityID, |
EntitySystem/MovieSceneEntityManager.h | ||
void RemoveComponents
(
FMovieSceneEntityID EntityID, |
Remove the specified components from an entity, if they exist. | EntitySystem/MovieSceneEntityManager.h | |
void RemoveComponents
(
FMovieSceneEntityID EntityID, |
EntitySystem/MovieSceneEntityManager.h | ||
void ReplaceEntityID
(
FMovieSceneEntityID& InOutEntity, |
Replace an entity ID with the components from another, discarding the provided entity ID in the process | EntitySystem/MovieSceneEntityManager.h | |
void SetComponentRegistry
(
FComponentRegistry* InComponents |
EntitySystem/MovieSceneEntityManager.h | ||
void SetDebugName
(
FString&& InNewDebugName |
Set a debug name for this entity manager | EntitySystem/MovieSceneEntityManager.h | |
void SetDispatchThread
(
ENamedThreads::Type InDispatchThread |
EntitySystem/MovieSceneEntityManager.h | ||
void SetGatherThread
(
ENamedThreads::Type InGatherThread |
EntitySystem/MovieSceneEntityManager.h | ||
void TouchEntity
(
FMovieSceneEntityID EntityID |
Touch the specified entity, cause the allocation and component serial numbers to be incremented. | EntitySystem/MovieSceneEntityManager.h | |
void UpdateThreadingModel() |
Compute and store the current threading model. | EntitySystem/MovieSceneEntityManager.h | |
TComponentLock< TWriteOptional< T > > WriteComponent
(
FMovieSceneEntityID Entity, |
Attempt to write to an entity's component. | EntitySystem/MovieSceneEntityManager.h | |
void WriteComponentChecked
(
FMovieSceneEntityID Entity, |
Write a component value that is known to exist to an entity. | EntitySystem/MovieSceneEntityManager.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static IComponentTypeHandler * FindComponentTypeHandler
(
const FGuid& ComponentGuid |
Find a component type hander from its registered GUID | EntitySystem/MovieSceneEntityManager.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void operator=
(
const FEntityManager& |
EntitySystem/MovieSceneEntityManager.h | ||
void operator=
(
FEntityManager&& |
EntitySystem/MovieSceneEntityManager.h |