Class ParticleEmitter
Binary asset that contains a particle emitter definition graph for running particles simulation on CPU and GPU.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Particles/ParticleEmitter.h
Syntax
public class ParticleEmitter : public ShaderAssetTypeBase
Fields
Capacity
The particle system capacity (the maximum amount of particles to simulate at once).
Declaration
public int32 Capacity
Field Value
int32
|
CustomBounds
The custom bounds to use for the particles. Set to zero to use automatic bounds (valid only for CPU particles).
Declaration
public BoundingBox CustomBounds
Field Value
BoundingBox
|
EnablePooling
True if enable pooling emitter instance data, otherwise immediately dispose. Pooling can improve performance and reduce memory usage.
Declaration
public bool EnablePooling
Field Value
bool
|
GPU
Graph
The loaded particle graph.
Declaration
public ParticleEmitterGraphCPU Graph
Field Value
ParticleEmitterGraphCPU
|
GraphExecutorCPU
The CPU graph executor runtime.
Declaration
public ParticleEmitterGraphCPUExecutor GraphExecutorCPU
Field Value
ParticleEmitterGraphCPUExecutor
|
IsUsingLights
True if emitter uses lights rendering, otherwise false.
Declaration
public bool IsUsingLights
Field Value
bool
|
SimulationMode
The particles simulation execution mode.
Declaration
public ParticlesSimulationMode SimulationMode
Field Value
ParticlesSimulationMode
|
SimulationSpace
The particles simulation space.
Declaration
public ParticlesSimulationSpace SimulationSpace
Field Value
ParticlesSimulationSpace
|
UseAutoBounds
True if use automatic bounds.
Declaration
public bool UseAutoBounds
Field Value
bool
|
Methods
getChunksToPreload()
Gets packed chunks indices to preload before asset loading action
Declaration
protected virtual AssetChunksFlag getChunksToPreload() const override
Returns
AssetChunksFlag
Chunks to load flags |
Overrides
GetReferences(Array<Guid>& assets, Array<String>& files)
Declaration
public void GetReferences(Array<Guid>& assets, Array<String>& files) const override
Parameters
Array<Guid>
assets
|
Array<String>
files
|
InitCompilationOptions(ShaderCompilationOptions& options)
Prepare shader compilation options.
Declaration
protected virtual void InitCompilationOptions(ShaderCompilationOptions& options) override
Parameters
ShaderCompilationOptions
options
The output options. |
Overrides
load()
Load data from the chunks
Declaration
protected virtual LoadResult load() override
Returns
LoadResult
Loading result |
Overrides
LoadSurface(bool createDefaultIfMissing)
Tries to load surface graph from the asset.
Declaration
public BytesContainer LoadSurface(bool createDefaultIfMissing)
Parameters
bool
createDefaultIfMissing
True if create default surface if missing. |
Returns
BytesContainer
The output surface data, or empty if failed to load. |
OnDependencyModified(BinaryAsset* asset)
Called when one of the asset dependencies gets modified (it was saved or reloaded or reimported).
Declaration
protected virtual void OnDependencyModified(BinaryAsset* asset) override
Parameters
BinaryAsset
asset
The modified asset that this asset depends on. |
Overrides
Save(const StringView& path=StringView::Empty)
Saves this asset to the file. Supported only in Editor.
Declaration
public virtual bool Save(const StringView& path=StringView::Empty) override
Parameters
StringView
path
The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset. |
Returns
bool
True when cannot save data, otherwise false. |
Overrides
SaveSurface(const BytesContainer& data)
Updates surface (saves new one, discard cached data, reloads asset).
Declaration
public bool SaveSurface(const BytesContainer& data)
Parameters
BytesContainer
data
The surface graph data. |
Returns
bool
True if cannot save it, otherwise false. |
Spawn(Actor* parent, const Transform& transform, float duration=MAX_float, bool autoDestroy=false)
Spawns the particles at the given location.
Declaration
public ParticleEffect* Spawn(Actor* parent, const Transform& transform, float duration=MAX_float, bool autoDestroy=false)
Parameters
Actor
parent
The parent actor (can be null to link it to the first loaded scene). |
Transform
transform
The spawn transform. |
float
duration
The effect playback duration (in seconds). |
bool
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Actor* parent, const Vector3& position, const Quaternion& rotation, float duration=MAX_float, bool autoDestroy=false)
Spawns the particles at the given location.
Declaration
public ParticleEffect* Spawn(Actor* parent, const Vector3& position, const Quaternion& rotation, float duration=MAX_float, bool autoDestroy=false)
Parameters
Actor
parent
The parent actor (can be null to link it to the first loaded scene). |
Vector3
position
The spawn position. |
Quaternion
rotation
The spawn rotation. |
float
duration
The effect playback duration (in seconds). |
bool
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Actor* parent, const Vector3& position, float duration=MAX_float, bool autoDestroy=false)
Spawns the particles at the given location.
Declaration
public ParticleEffect* Spawn(Actor* parent, const Vector3& position, float duration=MAX_float, bool autoDestroy=false)
Parameters
Actor
parent
The parent actor (can be null to link it to the first loaded scene). |
Vector3
position
The spawn position. |
float
duration
The effect playback duration (in seconds). |
bool
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(const Transform& transform, float duration=MAX_float, bool autoDestroy=false)
Spawns the particles at the given location.
Declaration
public ParticleEffect* Spawn(const Transform& transform, float duration=MAX_float, bool autoDestroy=false)
Parameters
Transform
transform
The spawn transform. |
float
duration
The effect playback duration (in seconds). |
bool
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(const Vector3& position, const Quaternion& rotation, float duration=MAX_float, bool autoDestroy=false)
Spawns the particles at the given location.
Declaration
public ParticleEffect* Spawn(const Vector3& position, const Quaternion& rotation, float duration=MAX_float, bool autoDestroy=false)
Parameters
Vector3
position
The spawn position. |
Quaternion
rotation
The spawn rotation. |
float
duration
The effect playback duration (in seconds). |
bool
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(const Vector3& position, float duration=MAX_float, bool autoDestroy=false)
Spawns the particles at the given location.
Declaration
public ParticleEffect* Spawn(const Vector3& position, float duration=MAX_float, bool autoDestroy=false)
Parameters
Vector3
position
The spawn position. |
float
duration
The effect playback duration (in seconds). |
bool
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
bool
isReloading
True if asset is reloading data, otherwise false. |