ParticleDistributions Class

Module: Particles

A map of supported distribution types used by ParticleEmitterControl instances.

These distribution types can be applied to an emitter globally, which will affect the position, velocity, and acceleration value calculations for an emitter, or they can be applied on a per-property basis.

Methods

dispose

()

Dispose particle emitter.

Should be called when destroying particle emitter.

onBeforeRender

()

Particle emitter state is automatically updated before rendering.

reload

()

Reload internal material and geometry of this particle emitter.

Recretes the group and emitter object attached to the particle.

May be required after changing material related parameters.

toJSON

(
  • meta
)
Object

Serialize object to JSON.

Parameters:

  • meta Object

Returns:

Object:

json

updateMatrix

()

Update particle object matrix.

Ignores the particle position if the moveEmitter attribute is set true.

Attributes

BOX

Number

Values will be distributed within a box.

defaultEmitter

Object

Default particle emitter configuration.

defaultGroup

Object

Default particle emitter group configuration.

DISC

Number

Values will be distributed on a 2d-disc shape.

SPHERE

Number

Values will be distributed on a sphere.

valueOverLifetimeLength

Number

Set this value to however many "steps" you want value-over-lifetime properties to have.

Its adjustable to fix an interpolation problem:

Assuming you specify an opacity value as [0, 1, 0] and the valueOverLifetimeLength is 4, then the opacity value array will be reinterpolated to be [0, 0.66, 0.66, 0]. This isn't ideal, as particles would never reach full opacity.

This property affects the length of ALL value-over-lifetime properties for ALL emitters and ALL groups. Only values >= 3 && <= 4 are allowed.