ParticleGroup Class

Module: Lights

The ParticleGroup class. Creates a new group, containing a material, geometry, and mesh.

Constructor

ParticleGroup

(
  • options
)

Parameters:

  • options ParticleGroupOptions

    A map of options to configure the group instance.

Methods

addEmitter

(
  • emitter
)

Adds an ParticleEmitterControl instance to this group, creating particle values and assigning them to this group"s shader attributes.

Parameters:

addPool

(
  • numEmitters
  • emitterOptions
  • createNew
)
ParticleGroup

Add a pool of emitters to this particle group

Parameters:

  • numEmitters Number

    The number of emitters to add to the pool.

  • emitterOptions ParticleEmitterControlOptions | Array

    An object, or array of objects, describing the options to pass to each emitter.

  • createNew Boolean

    Should a new emitter be created if the pool runs out?

Returns:

ParticleGroup:

This group instance.

dispose

() ParticleGroup

Dipose the geometry and material for the group.

Returns:

ParticleGroup:

ParticleGroup instance.

getFromPool

() ParticleEmitterControl | Null

Fetch a single emitter instance from the pool.

If there are no objects in the pool, a new emitter will becreated if specified.

Returns:

getPool

() Array

Get the pool array

Returns:

Array:

releaseIntoPool

(
  • emitter
)
ParticleGroup

Release an emitter into the pool.

Parameters:

  • emitter ShaderParticleParticleEmitterControl

Returns:

ParticleGroup:

This group instance.

removeEmitter

(
  • emitter
)

Removes an ParticleEmitterControl instance from this group.

When called, all particle"s belonging to the given emitter will be instantly removed from the scene.

Parameters:

tick

(
  • [dt=ParticleGroup"s fixedTimeStep value]
)

Simulate all the emitter"s belonging to this group, updating attribute values along the way.

Parameters:

  • [dt=ParticleGroup"s fixedTimeStep value] Number optional

    The number of seconds to simulate the group"s emitters for(deltaTime)

triggerEmitter

(
  • numEmitters
  • [position=undefined]
)
ParticleGroup

Set a given number of emitters as alive, with an optional position vector3 to move them to.

Parameters:

  • numEmitters Number

    The number of emitters to activate

  • [position=undefined] Object optional

    A Vector3 instance describing the position to activate the emitter(s) at.

Returns:

ParticleGroup:

This group instance.

Attributes

attributes

Object

Map of all attributes to be applied to the particles.

See ShaderAttribute for a bit more info on this bit.

uniforms

Object

Map of uniforms to be applied to the ShaderMaterial instance.