Options
All
  • Public
  • Public/Protected
  • All
Menu

All behaviors instances must implement this interface, and the class must match the IEmitterBehaviorClass interface. All behaviors must have an order property and initParticles method. Implementing the updateParticle or recycleParticle methods is optional.

Hierarchy

  • IEmitterBehavior

Implemented by

Index

Properties

order: number

Order in which the behavior will be handled. Lower numbers are handled earlier, with an order of 0 getting special treatment before the Emitter's transformation is applied.

Methods

  • Called to initialize a wave of particles, with a reference to the first particle in the linked list.

    Parameters

    • first: Particle

      The first (maybe only) particle in a newly spawned wave of particles.

    Returns void

  • recycleParticle(particle: Particle, natural: boolean): void
  • A hook for when a particle is recycled.

    Parameters

    • particle: Particle

      The particle that was just recycled.

    • natural: boolean

      true if the reycling was due to natural lifecycle, false if it was due to emitter cleanup.

    Returns void

  • updateParticle(particle: Particle, deltaSec: number): boolean | void
  • Updates a single particle for a given period of time elapsed. Return true to recycle the particle.

    Parameters

    • particle: Particle

      The particle to update.

    • deltaSec: number

      The time to advance the particle by in seconds.

    Returns boolean | void

Generated using TypeDoc