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

uint32: 1

 

bBindingsInitialized

Protected variable

uint32: 1

 

bCanExecute

Protected variable

uint32: 1

 

bInSpawnPhase

Protected variable

uint32: 1

 

bIsSolo

Protected variable

FNiagaraConstan...

 

ConstantBufferToDataSetBinding

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...

 

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

TArray< FNiagar...

 

EmitterExecutionStateAccessors

Protected variable

TArray< TArray<...

 

EmitterSpawnInfoAccessors

Protected variable

FNiagaraDataSet

 

MainDataSet

Main dataset containing system instance attribute data.

Protected variable

TOptional< floa...

 

MaxDeltaTime

Protected variable

FNiagaraDataSet

 

PausedInstanceData

DataSet used to store pausing instance data.

Protected variable

TArray< FNiagar...

 

PausedSystemInstances

System instances that are paused.

Protected variable

TArray< FNiagar...

 

PendingSystemInstances

System instances that are pending to be spawned.

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

FNiagaraScriptE...

 

SpawnExecContext

Protected variable

FNiagaraParamet...

 

SpawnGlobalSpawnCountScaleParam

Protected variable

FNiagaraParamet...

 

SpawnGlobalSystemCountScaleParam

Protected variable

FNiagaraDataSet

 

SpawningDataSet

DataSet used if we have to spawn instances outside of their tick.

Protected variable

TArray< FNiagar...

 

SpawningInstances

System instances that are about to be spawned outside of regular ticking.

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

FNiagaraDataSet...

 

SystemExecutionStateAccessor

Protected variable

TArray< FNiagar...

 

SystemInstances

System instances that have been spawned and are now simulating.

Protected variable

FGraphEventRef

 

SystemTickGraphEvent

Current task that is executing

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

FNiagaraScriptE...

 

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...
)

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

const FStrin...

 

GetCrashReporterTag()

Public function Const

bool

 

GetIsSolo()

Public function

UNiagaraPara...

 

GetParameterCollectionInstance

(
    UNiagaraParameterCollection* C...
)

Public function

FNiagaraPara...

 

GetScriptDefinedDataInterfaceParameters()

Public function

FNiagaraScri...

 

GetSpawnExecutionContext()

Public function Const

UNiagaraSyst...

 

GetSystem()

Public function

FNiagaraScri...

 

GetUpdateExecutionContext()

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

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

 

RemoveInstance

(
    FNiagaraSystemInstance* Instan...
)

Protected function

void

 

SetupParameters_GameThread

(
    float DeltaSeconds
)

Sets constant parameter values

Protected function

bool

 

ShouldTickAsync

(
    const FNiagaraSystemSimulationTickC...
)

Should we push the system sim tick off the game thread.

Protected function

bool

 

ShouldTickInstancesAsync

(
    const FNiagaraSystemSimulationTickC...
)

Should we push the system instance ticks off the game thread.

Public function

void

 

Spawn_GameThread

(
    float DeltaSeconds
)

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

bool

 

Tick

(
    float DeltaSeconds
)

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

(
    FNiagaraSystemSimulation* Sour...,
    FNiagaraSystemInstance* System...
)

Transfers a system instance from SourceSimulation.

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

void

 

WaitForInstancesTickComplete

(
    bool bEnsureComplete
)

Wait for instances tick to complete.

Public function

void

 

WaitForSystemTickComplete

(
    bool bEnsureComplete
)

Promote instances that have ticked during Wait for system simulation 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.

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