Navigation
API > API/Plugins > API/Plugins/MassRepresentation
Inheritance Hierarchy
- UWorldSubsystem
- UMassSubsystemBase
- UMassRepresentationSubsystem
- UInstancedActorsRepresentationSubsystem
- UMassCrowdRepresentationSubsystem
References
| Module | MassRepresentation |
| Header | /Engine/Plugins/Runtime/MassGameplay/Source/MassRepresentation/Public/MassRepresentationSubsystem.h |
| Include | #include "MassRepresentationSubsystem.h" |
Syntax
UCLASS ()
class UMassRepresentationSubsystem : public UMassSubsystemBase
Remarks
Subsystem responsible for all visual of mass agents, will handle actors spawning and static mesh instances
Variables
| Type | Name | Description | |
|---|---|---|---|
| TObjectPtr< UMassActorSpawnerSubsystem > | ActorSpawnerSubsystem | ||
| TSharedPtr< FMassEntityManager > | EntityManager | ||
| TMap< FMassEntityHandle, int32 > | HandledMassAgents | Keeping track of all the mass agent this subsystem is responsible for spawning actors | |
| float | RetryMovedDistanceSq | The time to wait before retrying a to spawn actor that failed | |
| float | RetryTimeInterval | The distance a failed spawned actor needs to move before we retry | |
| TSparseArray< FTemplateActorData > | TemplateActors | The array of all the template actors | |
| TObjectPtr< UMassVisualizationComponent > | VisualizationComponent | The component that handles all the static mesh instances | |
| TObjectPtr< AMassVisualizer > | Visualizer | The actor owning the above visualization component | |
| TObjectPtr< UWorldPartitionSubsystem > | WorldPartitionSubsystem |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddReferencedObjects
(
UObject* InThis, |
||
| FStaticMeshInstanceVisualizationDescHandle | AddVisualDescWithISMComponent
(
const FStaticMeshInstanceVisualizationDesc& Desc, |
Creates a dedicated visual type described by host Desc and ties ISMComponent to it. | |
| FStaticMeshInstanceVisualizationDescHandle | AddVisualDescWithISMComponents
(
const FStaticMeshInstanceVisualizationDesc& Desc, |
Creates a dedicated visual type described by host Desc and ties given ISMComponents to it. | |
| bool | CancelSpawning
(
const FMassEntityHandle MassAgent, |
Cancel spawning request that is matching the TemplateActorIndex | |
| bool | CancelSpawningInternal
(
const int16 TemplateActorIndex, |
||
| void | Mark render state of the static mesh instances dirty | ||
| bool | DoesActorMatchTemplate
(
const AActor& Actor, |
Compare if an actor matches the registered template actor | |
| FStaticMeshInstanceVisualizationDescHandle | FindOrAddStaticMeshDesc
(
const FStaticMeshInstanceVisualizationDesc& Desc |
Get the index of the static mesh visual type, will add a new one if does not exist | |
| int16 | FindOrAddTemplateActor
(
const TSubclassOf< AActor >& ActorClass |
Store the template actor uniquely and return an index to it | |
| UMassActorSpawnerSubsystem * | |||
| const FMassISMCSharedData * | GetISMCSharedDataForDescriptionIndex
(
const int32 DescriptionIndex |
Fetches FMassISMCSharedData indicated by DescriptionIndex, or nullptr if it's not a valid index | |
| const FMassISMCSharedData * | GetISMCSharedDataForInstancedStaticMesh
(
const UInstancedStaticMeshComponent* ISMC |
Fetches FMassISMCSharedData indicated by an ISMC, or nullptr if the ISMC is not represented by any shared data. | |
| FMassInstancedStaticMeshInfoArrayView | |||
| AActor * | GetOrSpawnActorFromTemplate
(
const FMassEntityHandle MassAgent, |
Get or spawn an actor from the TemplateActorIndex | |
| TSubclassOf< AActor > | GetTemplateActorClass
(
const int16 TemplateActorIndex |
||
| bool | IsCollisionLoaded
(
const FName TargetGrid, |
||
| void | OnMassAgentComponentEntityAssociated
(
const UMassAgentComponent& AgentComponent |
||
| void | OnMassAgentComponentEntityDetaching
(
const UMassAgentComponent& AgentComponent |
||
| void | OnProcessingPhaseStarted
(
const float DeltaSeconds, |
Needed for batching the update of static mesh transform | |
| void | Release all references to static meshes and template actors Use with caution, all entities using this representation subsystem must be destroy otherwise they will point to invalid resources | ||
| void | ReleaseTemplate
(
const TSubclassOf< AActor >& ActorClass |
Responds to the FMassEntityTemplate getting destroyed, and releases reference to corresponding Actor in TemplateActors | |
| bool | ReleaseTemplateActor
(
const FMassEntityHandle MassAgent, |
Release an actor that is matching the TemplateActorIndex | |
| bool | ReleaseTemplateActorInternal
(
const int16 TemplateActorIndex, |
||
| bool | ReleaseTemplateActorOrCancelSpawning
(
const FMassEntityHandle MassAgent, |
Release an actor or cancel its spawning if it is matching the TemplateActorIndex | |
| void | RemoveISMComponent
(
UInstancedStaticMeshComponent& ISMComponent |
Removes the visualization data associated with the given ISM component. | |
| void | RemoveVisualDesc
(
const FStaticMeshInstanceVisualizationDescHandle VisualizationHandle |
Removes all data associated with a given VisualizationIndex. | |
UE_MT_DECLARE_RW_ACCESS_DETECTOR
(
TemplateActorsMTAccessDetector |
Overridden from UMassSubsystemBase
| Type | Name | Description | |
|---|---|---|---|
| void | Deinitialize () |
||
| void | Initialize
(
FSubsystemCollectionBase& Collection |
USubsystem BEGIN. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FTemplateActorData | |||
| FTemplateActorEqualsPredicate |