Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is made for on one-liner static method to help creating particle system set.

Hierarchy

  • ParticleHelper

Index

Constructors

Properties

BaseAssetsUrl: string

Gets or sets base Assets URL

CreateFromSnippetAsync: ((snippetId: string, scene: Scene, gpu?: boolean, rootUrl?: string, capacity?: number) => Promise<IParticleSystem>)

Type declaration

    • (snippetId: string, scene: Scene, gpu?: boolean, rootUrl?: string, capacity?: number): Promise<IParticleSystem>
    • Creates a particle system from a snippet saved by the particle system editor

      Parameters

      • snippetId: string

        defines the snippet to load (can be set to _BLANK to create a default one)

      • scene: Scene

        defines the hosting scene

      • Optional gpu: boolean

        If the system will use gpu

      • Optional rootUrl: string

        defines the root URL to use to load textures and relative dependencies

      • Optional capacity: number

        defines the system capacity (if null or undefined the sotred capacity will be used)

      Returns Promise<IParticleSystem>

      a promise that will resolve to the new particle system

SnippetUrl: string

Define the Url to load snippets

Methods

  • This is the main static method (one-liner) of this helper to create different particle systems

    Parameters

    • type: string

      This string represents the type to the particle system to create

    • scene: Nullable<Scene>

      The scene where the particle system should live

    • Optional gpu: boolean

      If the system will use gpu

    • Optional capacity: number

      defines the system capacity (if null or undefined the sotred capacity will be used)

    Returns Promise<ParticleSystemSet>

    the ParticleSystemSet created

  • Create a default particle system that you can tweak

    Parameters

    • emitter: Nullable<AbstractMesh | Vector3>

      defines the emitter to use

    • Optional capacity: number

      defines the system capacity (default is 500 particles)

    • Optional scene: Scene

      defines the hosting scene

    • Optional useGPU: boolean

      defines if a GPUParticleSystem must be created (default is false)

    Returns IParticleSystem

    the new Particle system

  • Static function used to export a particle system to a ParticleSystemSet variable. Please note that the emitter shape is not exported

    Parameters

    Returns ParticleSystemSet

    the created particle system set

  • ParseFromFileAsync(name: Nullable<string>, url: string, scene: Scene, gpu?: boolean, rootUrl?: string, capacity?: number): Promise<IParticleSystem>
  • Creates a particle system from a snippet saved in a remote file

    Parameters

    • name: Nullable<string>

      defines the name of the particle system to create (can be null or empty to use the one from the json data)

    • url: string

      defines the url to load from

    • scene: Scene

      defines the hosting scene

    • Optional gpu: boolean

      If the system will use gpu

    • Optional rootUrl: string

      defines the root URL to use to load textures and relative dependencies

    • Optional capacity: number

      defines the system capacity (if null or undefined the sotred capacity will be used)

    Returns Promise<IParticleSystem>

    a promise that will resolve to the new particle system

  • ParseFromSnippetAsync(snippetId: string, scene: Scene, gpu?: boolean, rootUrl?: string, capacity?: number): Promise<IParticleSystem>
  • Creates a particle system from a snippet saved by the particle system editor

    Parameters

    • snippetId: string

      defines the snippet to load (can be set to _BLANK to create a default one)

    • scene: Scene

      defines the hosting scene

    • Optional gpu: boolean

      If the system will use gpu

    • Optional rootUrl: string

      defines the root URL to use to load textures and relative dependencies

    • Optional capacity: number

      defines the system capacity (if null or undefined the sotred capacity will be used)

    Returns Promise<IParticleSystem>

    a promise that will resolve to the new particle system

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static property
  • Static method
  • Inherited constructor

Settings

Theme