UMassRepresentationProcessor

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MassRepresentation

Header

/Engine/Plugins/Runtime/MassGameplay/Source/MassRepresentation/Public/MassRepresentationProcessor.h

Include

#include "MassRepresentationProcessor.h"

Syntax

UCLASS()
class UMassRepresentationProcessor : public UMassProcessor

Variables

Name Description

Protected variable UProperty Category, EditAnywhere Config

bool

 

bKeepActorExtraFrame

When switching to ISM keep the actor an extra frame, helps cover rendering glitches (i.e. occlusion query being one frame late)

Protected variable UProperty Category, EditAnywhere Config

bool

 

bKeepLowResActors

If true, LowRes actors will be kept around, disabled, whilst StaticMeshInstance representation is active

Protected variable UProperty Category, EditAnywhere Config

bool

 

bSpreadFirstVisualizationUpdate

If true, will spread the first visualization update over the period specified in NotVisibleUpdateRate member

Protected variable UProperty Transient

UMassEntitySubs...

 

CachedEntitySubsystem

Protected variable

ERepresentation...

 

DefaultRepresentationType

Default representation when unable to spawn an actor

Protected variable

FMassEntityQuer...

 

EntityQuery

Protected variable UProperty Category, EditAnywhere Config

ERepresentation...

 

LODRepresentation

What should be the representation of this entity for each specificLOD

Protected variable UProperty Category, EditAnywhere Config

float

 

NotVisibleUpdateRate

At what rate should the not visible entity be updated in seconds

Protected variable UProperty Transient

UMassRepresenta...

 

RepresentationSubsystem

A cache pointer to the representation subsystem

Protected variable UProperty Transient

UWorld *

 

World

Caching ptr to our associated world

Protected variable UProperty Category, EditAnywhere Config

FName

 

WorldPartitionGridNameContainingCollision

World Partition grid name to test collision against, default None will be the main grid

Constructors

Functions

Name Description

Protected function Virtual

void

 

ConfigureQueries()

Configure the owned FMassEntityQuery instances to express processor's requirements

Protected function Virtual

void

 

Execute

(
    UMassEntitySubsystem& EntitySubsys...,
    FMassExecutionContext& Context
)

Execution method for this processor

Protected function Virtual

AActor *

 

GetOrSpawnActor

(
    const FMassEntityHandle MassAgent,
    FDataFragment_Actor& ActorInfo,
    const FTransform& Transform,
    const int16 TemplateActorIndex,
    FMassActorSpawnRequestHandle& Spaw...,
    const float Priority
)

Returns an actor of the template type and setup fragments values from it

Protected function Virtual

float

 

GetSpawnPriority

(
    const FMassRepresentationLODFragmen...
)

Protected function

EMassActorSp...

 

OnActorPostSpawn

(
    const FMassActorSpawnRequestHandle ...,
    const FStructView& SpawnRequest
)

Method that will be bound to a delegate used post-spawn to notify and let the requester configure the actor

Protected function

void

 

OnActorPreSpawn

(
    const FMassActorSpawnRequestHandle ...,
    const FStructView& SpawnRequest
)

Method that will be bound to a delegate called before the spawning of an actor to let the requester prepare it

Protected function Virtual

void

 

PostActorSpawned

(
    const FMassEntityHandle MassAgent,
    AActor& SpawnedActor
)

Method called once the spawning of an actor just occurred, give the processors a chance to configure the actor during the spawn time slicing

Protected function Virtual

bool

 

ReleaseActorOrCancelSpawning

(
    const FMassEntityHandle MassAgent,
    FDataFragment_Actor& ActorInfo,
    const int16 TemplateActorIndex,
    FMassActorSpawnRequestHandle& Spaw...,
    FMassCommandBuffer& CommandBuffer,
    const bool bCancelSpawningOnly
)

Release the actor to the subsystem, will only release it the actor or spawn request matches the template actor

Public function Static

void

 

ReleaseAnyActorOrCancelAnySpawning

(
    UMassRepresentationSubsystem& Repr...,
    const FMassEntityHandle MassAgent
)

Release an actor or cancel its spawning (calls ReleaseAnyActorOrCancelAnySpawning) WARNING: This method will destroy the associated actor in any and by the same fact might also move the entity into a new archetype.

Public function Static

void

 

ReleaseAnyActorOrCancelAnySpawning

(
    UMassRepresentationSubsystem& Repr...,
    const FMassEntityHandle MassAgent,
    FDataFragment_Actor& ActorInfo,
    FMassRepresentationFragment& Repre...
)

Release an actor or cancel its spawning WARNING: This method will destroy the associated actor in any and by the same fact might also move the entity into a new archetype.

Protected function Virtual

void

 

SetActorEnabled

(
    const EActorEnabledType EnabledType,
    AActor& Actor,
    const int32 EntityIdx,
    FMassCommandBuffer& CommandBuffer
)

Enable/disable a spawned actor

Protected function Virtual

void

 

TeleportActor

(
    const FTransform& Transform,
    AActor& Actor,
    FMassCommandBuffer& CommandBuffer
)

Teleports the actor at the specified transform by preserving its velocity and without collision.

Protected function Const

FMassVisuali...

 

UpdateChunkVisibility

(
    FMassExecutionContext& Context
)

Updates chunk visibility info for later chunk logic optimization

Protected function Static

void

 

UpdateEntityVisibility

(
    const FMassEntityHandle Entity,
    const FMassRepresentationFragment&...,
    const FMassRepresentationLODFragmen...,
    FMassVisualizationChunkFragment& C...,
    FMassCommandBuffer& CommandBuffer
)

Updates entity visibility tag for later chunk logic optimization

Protected function

void

 

UpdateRepresentation

(
    FMassExecutionContext& Context
)

Update representation type for each entity, must be called within a ForEachEntityChunk

Protected function

void

 

UpdateVisualization

(
    FMassExecutionContext& Context
)

Update representation and visibility for each entity, must be called within a ForEachEntityChunk

Overridden from UMassProcessor

Name Description

Protected function Virtual

void

 

Initialize

(
    UObject& Owner
)

Initialize the processor