ParticleSystem represents a system that generates and controls particles with similar attributes.

Implements

Constructors

Properties

_renderer?: BatchedRenderer
autoDestroy: boolean

whether the ParticleSystem should be automatically disposed when it finishes emitting particles.

behaviors: Behavior[]

a list of particle behaviors in the particle system

duration: number

The duration of the ParticleSystem in seconds.

emissionBursts: BurstParameters[]

An array of burst parameters for the ParticleSystem.

emissionOverDistance: ValueGenerator | FunctionValueGenerator

The value generator or function value generator for the emission rate of particles over distance.

The value generator or function value generator for the emission rate of particles over time.

emissionState: EmissionState

the emitter object that should be added in the scene.

emitterShape: EmitterShape

the shape of the emitter.

looping: boolean

Determines whether the ParticleSystem should loop, i.e., restart emitting particles after the duration of the particle system is expired.

neededToUpdateRender: boolean

whether needs to update renderer settings for the batch renderer

onlyUsedByOther: boolean

Determines whether the ParticleSystem is only used by other ParticleSystems.

particleNum: number

The number of particles in the ParticleSystem.

particles: Particle[]

All the particles in the ParticleSystem.

paused: boolean

Determines whether the ParticleSystem is paused.

prewarm: boolean

Determines whether a looping ParticleSystem should prewarm, i.e., the Particle System looks like it has already simulated for one loop when first becoming visible.

rendererEmitterSettings: RendererEmitterSettings

The renderer emitter settings for the ParticleSystem.

rendererSettings: VFXBatchSettings

the VFX renderer settings for the batch renderer

The color generator or function color generator for the starting color of particles.

The value generator or function value generator for the starting life of particles.

The value generator or function value generator or rotation generator for the starting rotation of particles.

The value generator or function value generator for the starting size of particles.

The value generator or function value generator for the starting speed of particles.

startTileIndex: ValueGenerator

The value generator for the starting tile index of particles.

worldSpace: boolean

Determines whether the ParticleSystem is in world space or local space.

Accessors

  • get renderOrder(): number
  • get the render order of the particle system in render pipeline. the higher the value, the later the particle system is rendered.

    Returns number

  • set renderOrder(renderOrder: number): void
  • set the render order of the particle system in render pipeline. the higher the value, the later the particle system is rendered.

    Parameters

    • renderOrder: number

    Returns void

  • get softParticles(): boolean
  • Get whether the particle system uses soft particles. Soft particles are particles that fade out when they are close to geometry.

    Returns boolean

  • set softParticles(v: boolean): void
  • Set whether the particle system uses soft particles. Soft particles are particles that fade out when they are close to geometry.

    Parameters

    • v: boolean

    Returns void

Methods

  • Create a ParticleSystem from JSON

    Parameters

    • json: ParticleSystemJSONParameters

      the JSON data

    • meta: {
          geometries: { [uuid: string]: BufferGeometry };
          materials: { [uuoid: string]: Material };
          textures: { [uuid: string]: Texture };
      }

      serialization meta data

    • dependencies: { [uuid: string]: Behavior }

      the dependencies of the particle system

    Returns ParticleSystem