three-nebula API
    Preparing search index...

    Class System

    The core of the three-system particle engine. A System instance can contain multiple emitters, each with their own initializers and behaviours.

    Index
    • Parameters

      • preParticles: number = POOL_MAX
      • integrationType: string = INTEGRATION_TYPE_EULER

      Returns System

    canUpdate: boolean
    emitters: Emitter[]
    eventDispatcher: EventDispatcher
    integrationType: string
    pool: Pool
    preParticles: number
    renderers: BaseRenderer[]
    type: string
    • Adds an emitter to the System instance. Dispatches the EMITTER_ADDED event.

      Parameters

      Returns this

    • Adds a renderer to the System instance and initializes it.

      Parameters

      • renderer: BaseRenderer

      Returns this

    • Destroys all emitters, renderers and the Nebula pool.

      Returns void

    • Proxy method for the internal event dispatcher's dispatchEvent method.

      Parameters

      • event: string
      • target: unknown = ...

      Returns void

    • Wires up life cycle methods and causes a system's emitters to emit particles.

      Parameters

      • __namedParameters: LifeCycleHooks

      Returns Promise<unknown[]> | undefined

    • Gets a count of the total number of particles in the system.

      Returns number

    • Removes an emitter from the System instance. Dispatches the EMITTER_REMOVED event.

      Parameters

      Returns this

    • Removes a renderer from the System instance.

      Parameters

      • renderer: BaseRenderer

      Returns this

    • Updates the particle system based on the delta passed.

      Parameters

      • delta: number = DEFAULT_SYSTEM_DELTA

      Returns Promise<void>

    • Creates a System instance from a JSON object.

      Parameters

      • json: SystemJSON
      • THREE: __module

      Returns System

      use fromJSONAsync instead

    • Loads a System instance from JSON asynchronously. Ensures all textures are fully loaded before resolving with the instantiated System instance.

      Parameters

      • json: SystemJSON
      • THREE: __module
      • Optionaloptions: FromJSONAsyncOptions

      Returns Promise<System>