FNiagaraSystemSimulation

Simulation performing all system and emitter scripts for a instances of a [UNiagaraSystem](API\Plugins\Niagara\UNiagaraSystem) in a world.

Windows
MacOS
Linux

Inheritance Hierarchy

TSharedFromThis

FGCObject

FNiagaraSystemSimulation

References

Module

Niagara

Header

/Engine/Plugins/FX/Niagara/Source/Niagara/Public/NiagaraSystemSimulation.h

Include

#include "NiagaraSystemSimulation.h"

Syntax

class FNiagaraSystemSimulation :
    public TSharedFromThis< FNiagaraSystemSimulation, ESPMode::ThreadSafe >,
    private FGCObject

Remarks

Simulation performing all system and emitter scripts for a instances of a UNiagaraSystem in a world.

Variables

Name Description

Protected variable

FGraphEventRef

 

AllWorkCompleteGraphEvent

Event to track all work is complete, i.e. System Concurrent, Instance Concurrent, Finalize

Protected variable

NiagaraEmitterI...

 

Batcher

Protected variable

uint32: 1

 

bBindingsInitialized

Protected variable

uint32: 1

 

bCanExecute

Protected variable

uint32: 1

 

bInSpawnPhase

Protected variable

uint32: 1

 

bIsSolo

Protected variable

FGraphEventRef

 

ConcurrentTickGraphEvent

Event to track the system simulation async tick is complete.

Protected variable

FString

 

CrashReporterTag

Protected variable

TArray< TArray<...

 

DataSetToEmitterEventParameters

Binding to push system attributes into each emitter event parameters.

Protected variable

TArray< FNiagar...

 

DataSetToEmitterGPUParameters

Binding to push system attributes into each emitter gpu parameters.

Protected variable

TArray< FNiagar...

 

DataSetToEmitterRendererParameters

Binding to push system attributes into each emitter renderer parameters.

Protected variable

TArray< FNiagar...

 

DataSetToEmitterSpawnParameters

Binding to push system attributes into each emitter spawn parameters.

Protected variable

TArray< FNiagar...

 

DataSetToEmitterUpdateParameters

Binding to push system attributes into each emitter update parameters.

Protected variable

UNiagaraEffectT...

 

EffectType

We cache off the effect type in the unlikely even that someone GCs the System from under us so that we can keep the effect types instance count etc accurate.

Protected variable

FNiagaraDataSet

 

MainDataSet

Data set for the Running instance state.

Protected variable

TOptional< floa...

 

MaxDeltaTime

Protected variable

FNiagaraDataSet

 

PausedDataSet

Data set for the Paused instance state.

Protected variable

TArray< FNiagar...

 

PendingTickGroupPromotions

List of instances that are pending a tick group promotion.

Protected variable

FNiagaraParamet...

 

ScriptDefinedDataInterfaceParameters

A parameter store which contains the data interfaces parameters which were defined by the scripts.

Protected variable

TUniquePtr< FNi...

 

SpawnExecContext

Protected variable

FNiagaraParamet...

 

SpawnGlobalSpawnCountScaleParam

Protected variable

FNiagaraParamet...

 

SpawnGlobalSystemCountScaleParam

Protected variable

FNiagaraDataSet

 

SpawningDataSet

Data set for the Spawning instance state.

Protected variable

FNiagaraDataSet

 

SpawnInstanceParameterDataSet

As there's a 1 to 1 relationship between system instance and their execution in this simulation we must pull all that instances parameters into a dataset for simulation.

Protected variable

FNiagaraParamet...

 

SpawnInstanceParameterToDataSetBinding

Bindings that pull per component parameters into the spawn parameter dataset.

Protected variable

FNiagaraParamet...

 

SpawnNumSystemInstancesParam

Direct bindings for Engine variables in System Spawn and Update scripts.

Protected variable

TArray< FNiagar...

 

SystemInstancesPerState

System instance per state.

Protected variable

ETickingGroup

 

SystemTickGroup

Which tick group we are in, only valid when not in Solo mode.

Protected variable

FNiagaraSystemT...

 

TickBatch

Current tick batch we're filling ready for processing, potentially in an async task.

Protected variable

TUniquePtr< FNi...

 

UpdateExecContext

Protected variable

FNiagaraParamet...

 

UpdateGlobalSpawnCountScaleParam

Protected variable

FNiagaraParamet...

 

UpdateGlobalSystemCountScaleParam

Protected variable

FNiagaraDataSet

 

UpdateInstanceParameterDataSet

Protected variable

FNiagaraParamet...

 

UpdateInstanceParameterToDataSetBinding

Bindings that pull per component parameters into the update parameter dataset.

Protected variable

FNiagaraParamet...

 

UpdateNumSystemInstancesParam

Protected variable

TWeakObjectPtr<...

 

WeakSystem

System of instances being simulated.

Protected variable

UWorld *

 

World

World this system simulation belongs to.

Constructors

Name Description

Public function

FNiagaraSystemSimulation()

Destructors

Name Description

Public function

~FNiagaraSystemSimulation()

Functions

Name Description

Public function

void

 

AddInstance

(
    FNiagaraSystemInstance* Instan...
)

Protected function

void

 

AddSystemToTickBatch

Public function

void

 

AddTickGroupPromotion

(
    FNiagaraSystemInstance* Instan...
)

Public function

void

 

AddToInstanceList

(
    FNiagaraSystemInstance* Instan...,
    ENiagaraSystemInstanceState Instanc...
)

Protected function Const

void

 

BuildConstantBufferTable

Builds the constant buffer table for a given script execution

Public function

void

 

Destroy()

Public function Const

void

 

DumpInstance

(
    const FNiagaraSystemInstance* ...
)

Public function

void

 

DumpTickInfo

(
    FOutputDevice& Ar
)

Dump information about all instances tick

Protected function

void

 

FlushTickBatch

Public function Const

NiagaraEmitt...

 

GetBatcher()

Public function Const

const FStrin...

 

GetCrashReporterTag()

Public function Const

ENiagaraGPUT...

 

GetGPUTickHandlingMode()

Public function Const

bool

 

GetIsSolo()

Public function

UNiagaraPara...

 

GetParameterCollectionInstance

(
    UNiagaraParameterCollection* C...
)

Public function

FNiagaraPara...

 

GetScriptDefinedDataInterfaceParameters()

Public function

FNiagaraScri...

 

GetSpawnExecutionContext()

Public function Const

UNiagaraSyst...

 

GetSystem()

Protected function

TArray< FNia...

 

GetSystemInstances

(
    ENiagaraSystemInstanceState State
)

Public function Const

ETickingGrou...

 

GetTickGroup()

Public function

FNiagaraScri...

 

GetUpdateExecutionContext()

Public function Const

UWorld *

 

GetWorld()

Public function

bool

 

Init

(
    UNiagaraSystem* InSystem,
    UWorld* InWorld,
    bool bInIsSolo,
    ETickingGroup TickGroup
)

Protected function

void

 

InitParameterDataSetBindings

(
    FNiagaraSystemInstance* System...
)

Public function Const

bool

 

IsValid()

Public function Static

void

 

OnChanged_UseLegacySystemSimulationContexts

(
    IConsoleVariable* CVar
)

If true we use legacy simulation contexts that could not handle per instance DI calls in the system scripts and would force the whole simulation solo.

Public function

void

 

PauseInstance

(
    FNiagaraSystemInstance* Instan...
)

Protected function

void

 

PrepareForSystemSimulate

Does any prep work for system simulation such as pulling instance parameters into a dataset.

Public function

void

 

RemoveFromInstanceList

(
    FNiagaraSystemInstance* Instan...
)

Public function

void

 

RemoveInstance

(
    FNiagaraSystemInstance* Instan...
)

Public function

void

 

SetInstanceState

(
    FNiagaraSystemInstance* Instan...,
    ENiagaraSystemInstanceState NewStat...
)

Protected function

void

 

SetupParameters_GameThread

(
    float DeltaSeconds
)

Sets constant parameter values

Public function

void

 

Spawn_Concurrent

Spawn any pending instances

Public function

void

 

Spawn_GameThread

(
    float DeltaSeconds,
    bool bPostActorTick
)

Spawn any pending instances, assumes that you have update tick groups ahead of time.

Protected function

void

 

SpawnSystemInstances

Runs the system spawn script for new system instances.

Public function

void

 

Tick_Concurrent

Second phase of system sim tick that can run on any thread.

Public function

void

 

Tick_GameThread

(
    float DeltaSeconds,
    const FGraphEventRef& MyCompletion...
)

First phase of system sim tick. Must run on GameThread.

Public function

void

 

TransferInstance

(
    FNiagaraSystemInstance* System...
)

Transfers a system instance from the current simulation into this one.

Protected function

void

 

TransferSystemSimResults

Transfers the results of the system simulation into the emitter instances.

Public function

void

 

UnpauseInstance

(
    FNiagaraSystemInstance* Instan...
)

Protected function

void

 

UpdateSystemInstances

Runs the system update script.

Public function

void

 

UpdateTickGroups_GameThread()

Update TickGroups for pending instances and execute tick group promotions.

Public function Static

bool

 

UseLegacySystemSimulationContexts()

If true we use legacy simulation contexts that could not handle per instance DI calls in the system scripts and would force the whole simulation solo.

Public function

void

 

WaitForConcurrentTickComplete

(
    bool bEnsureComplete
)

Promote instances that have ticked during Wait for system simulation concurrent tick to complete.

Public function

void

 

WaitForInstancesTickComplete

(
    bool bEnsureComplete
)

Wait for system instances concurrent tick to complete.

Overridden from FGCObject

Name Description

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Pure virtual that must be overloaded by the inheriting class.

Constants

Name

Description

bUseLegacyExecContexts

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss