IParticleSystem

Interface representing a particle system in Babylon. This groups the common functionalities that needs to be implemented in order to create a particle system. A particle system represents a way to manage particles from their emission to their animation and rendering.

Hierarchy

  • IParticleSystem

Implemented by

Index

Properties

blendMode

blendMode: number

Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.

color1

color1: Color4

Random color of each particle after it has been emitted, between color1 and color2 vectors.

color2

color2: Color4

Random color of each particle after it has been emitted, between color1 and color2 vectors.

colorDead

colorDead: Color4

Color the particle will have at the end of its lifetime.

emitRate

emitRate: number

The maximum number of particles to emit per frame until we reach the activeParticleCount value

emitter

The emitter represents the Mesh or position we are attaching the particle system to.

gravity

gravity: Vector3

You can use gravity if you want to give an orientation to your particles.

id

id: string

The id of the Particle system.

layerMask

layerMask: number

The layer mask we are rendering the particles through.

maxEmitPower

maxEmitPower: number

Maximum power of emitting particles.

maxLifeTime

maxLifeTime: number

Maximum life time of emitting particles.

maxSize

maxSize: number

Maximum Size of emitting particles.

minEmitPower

minEmitPower: number

Minimum power of emitting particles.

minLifeTime

minLifeTime: number

Minimum life time of emitting particles.

minSize

minSize: number

Minimum Size of emitting particles.

name

name: string

The name of the Particle system.

particleEmitterType

particleEmitterType: Nullable<IParticleEmitterType>

The particle emitter type defines the emitter used by the particle system. It can be for example box, sphere, or cone...

particleTexture

particleTexture: Nullable<Texture>

The texture used to render each particle. (this can be a spritesheet)

renderingGroupId

renderingGroupId: number

The rendering group used by the Particle system to chose when to render.

targetStopDuration

targetStopDuration: number

The amount of time the particle system is running (depends of the overall update speed).

updateSpeed

updateSpeed: number

The overall motion speed (0.01 is default update speed, faster updates = faster animation)

Methods

animate

  • animate(): void
  • Animates the particle system for this frame.

    Returns void

clone

  • Clones the particle system.

    Parameters

    • name: string

      The name of the cloned object

    • newEmitter: any

      The new emitter to use

    Returns Nullable<IParticleSystem>

    the cloned particle system

dispose

  • dispose(disposeTexture?: boolean): void
  • Dispose the particle system and frees its associated resources.

    Parameters

    • Optional disposeTexture: boolean

      defines if the particule texture must be disposed as well (true by default)

    Returns void

getCapacity

  • getCapacity(): number
  • Gets the maximum number of particles active at the same time.

    Returns number

    The max number of active particles.

isReady

  • isReady(): boolean
  • Is this system ready to be used/rendered

    Returns boolean

    true if the system is ready

isStarted

  • isStarted(): boolean
  • isStarted(): boolean
  • Gets Wether the system has been started.

    Returns boolean

    True if it has been started, otherwise false.

  • Gets if the particle system has been started.

    Returns boolean

    true if the system has been started, otherwise false.

rebuild

  • rebuild(): void
  • Rebuild the particle system

    Returns void

render

  • render(): number
  • Renders the particle system in its current state.

    Returns number

    the current number of particles

reset

  • reset(): void
  • Remove all active particles

    Returns void

serialize

  • serialize(): any
  • Serializes the particle system to a JSON object.

    Returns any

    the JSON object

start

  • start(): void
  • Starts the particle system and begins to emit.

    Returns void

stop

  • stop(): void
  • Stops the particle system.

    Returns void

Generated using TypeDoc