Search Results for

    Show / Hide Table of Contents

    Class ParticleEmitter

    Binary asset that contains a particle emitter definition graph for running particles simulation on CPU and GPU.

    Inheritance
    Object
    ScriptingObject
    ManagedScriptingObject
    Asset
    BinaryAsset
    ShaderAssetTypeBase
    ParticleEmitter
    Inherited Members
    Asset::_deleteFileOnUnload
    BinaryAsset::_dependantAssets
    ScriptingObject::_gcHandle
    BinaryAsset::_header
    ScriptingObject::_id
    BinaryAsset::_isSaving
    Asset::_isVirtual
    Asset::_loadingTask
    Asset::_loadState
    Asset::_refCount
    ShaderAssetBase::_shaderHeader
    BinaryAsset::_storageRef
    ScriptingObject::_type
    BinaryAsset::AddDependency(BinaryAsset* asset)
    Asset::AddReference()
    Asset::Asset(const SpawnParams& params, const AssetInfo* info)
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    Asset::CancelStreaming()
    ScriptingObject::Cast(ScriptingObject* obj)
    Asset::ChangeID(const Guid& newId)
    BinaryAsset::ClearDependencies()
    Asset::const
    BinaryAsset::createLoadingTask()
    Asset::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    Asset::DECLARE_ENUM_7(LoadResult, Ok, Failed, MissingDataChunk, CannotLoadData, CannotLoadStorage, CannotLoadInitData, InvalidData)
    ScriptingObject::Deleted
    Asset::DeleteManaged()
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    BinaryAsset::Dependencies
    Asset::DEPRECATED("Use GetReferences with assets and files parameter instead")
    Asset::DestroyManaged()
    ParticleEmitter
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ShaderAssetBase::GetCacheChunkIndex()
    ShaderAssetBase::GetCacheChunkIndex(ShaderProfile profile)
    BinaryAsset::GetChunk(int32 index)
    BinaryAsset::GetChunkData(int32 index, BytesContainer& data)
    BinaryAsset::GetChunkSize(int32 index)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    BinaryAsset::GetImportMetadata(String& path, String& username)
    BinaryAsset::GetImportPath()
    ScriptingObject::GetManagedInstance()
    BinaryAsset::GetMemoryUsage()
    BinaryAsset::GetOrCreateChunk(int32 index)
    ScriptingObject::GetOrCreateManagedInstance()
    BinaryAsset::GetPath()
    Asset::GetReferences(Array<Guid, HeapAllocation>& assets, Array<String, HeapAllocation>& files)
    Asset::GetReferences()
    Asset::GetReferencesCount()
    BinaryAsset::GetSerializedVersion()
    ShaderAssetTypeBase::GetShaderAsset()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    Asset::GetTypeName()
    BinaryAsset::HasChunk(int32 index)
    BinaryAsset::HasChunkLoaded(int32 index)
    BinaryAsset::HasDependenciesModified()
    ScriptingObject::HasManagedInstance()
    BinaryAsset::Init(const FlaxStorageReference& storage, AssetHeader& header)
    BinaryAsset::Init(AssetInitData& initData)
    ShaderAssetTypeBase::init(AssetInitData& initData)
    Asset::InitAsVirtual()
    ShaderAssetBase::initBase(AssetInitData& initData)
    BinaryAsset::InitVirtual(AssetInitData& initData)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    Asset::IsInternalType()
    Asset::IsLoaded()
    ShaderAssetBase::IsNullRenderer()
    ScriptingObject::IsRegistered()
    Asset::IsVirtual()
    Asset::LastLoadFailed()
    BinaryAsset::loadAsset()
    BinaryAsset::LoadChunk(int32 chunkIndex)
    BinaryAsset::LoadChunks(AssetChunksFlag chunks)
    ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result)
    ParticleEmitter
    Asset::Locker
    ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
    BinaryAsset::Metadata
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    Asset::OnCheckSave(const StringView& path=StringView::Empty)
    BinaryAsset::OnDeleteObject()
    Asset::onLoad(LoadAssetTask* task)
    Asset::OnLoaded
    Asset::onLoaded()
    Asset::onLoaded_MainThread()
    Asset::OnManagedInstanceDeleted()
    Asset::OnReloading
    BinaryAsset::onRename(const StringView& newPath)
    Asset::OnScriptingDispose()
    Asset::onUnload_MainThread()
    Asset::OnUnloaded
    ShaderAssetBase::RegisterForShaderReloads(Asset* asset, const ShaderCacheResult& shaderCache)
    ScriptingObject::RegisterObject()
    BinaryAsset::Reimport()
    BinaryAsset::ReleaseChunk(int32 index)
    BinaryAsset::ReleaseChunks()
    BinaryAsset::releaseStorage()
    Asset::Reload()
    Asset::RemoveReference()
    BinaryAsset::RequestChunkDataAsync(int32 index)
    BinaryAsset::SaveAsset(AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    ShaderAssetBase::SaveShaderAsset()
    BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    BinaryAsset::SetChunk(int32 index, const Span<byte>& data)
    ManagedScriptingObject::SetManagedInstance(MObject* instance)
    ShaderAssetTypeBase::ShaderAssetTypeBase(const ScriptingObjectSpawnParams& params, const AssetInfo* info)
    ShaderAssetTypeBase::ShadersSerializedVersion
    Asset::ShouldDeleteFileOnUnload()
    ParticleEmitter
    Asset::startLoading()
    BinaryAsset::Storage
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    Asset::ToString()
    ShaderAssetBase::UnregisterForShaderReloads(Asset* asset)
    ScriptingObject::UnregisterObject()
    Asset::WaitForLoaded(double timeoutInMilliseconds=30000.0)
    BinaryAsset::~BinaryAsset()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    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

    The GPU particle simulation handler.

    Declaration
    public GPUParticles GPU
    Field Value
    GPUParticles

    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
    BinaryAsset::getChunksToPreload()

    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
    ShaderAssetBase::InitCompilationOptions(struct ShaderCompilationOptions& options)

    load()

    Load data from the chunks

    Declaration
    protected virtual LoadResult load() override
    Returns
    LoadResult

    Loading result

    Overrides
    BinaryAsset::load()

    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
    BinaryAsset::OnDependencyModified(BinaryAsset* asset)

    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
    Asset::Save(const StringView& path=StringView::Empty)

    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 true effect will be auto-destroyed after duration.

    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 true effect will be auto-destroyed after duration.

    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 true effect will be auto-destroyed after duration.

    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 true effect will be auto-destroyed after duration.

    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 true effect will be auto-destroyed after duration.

    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 true effect will be auto-destroyed after duration.

    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.

    Overrides
    Asset::unload(bool isReloading)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat