ParticleSystem

open external class ParticleSystem(options: ParticleSystem.ConstructorOptions? = definedExternally)(source)

A ParticleSystem manages the updating and display of a collection of particles.

See also

Constructors

Link copied to clipboard
constructor(options: ParticleSystem.ConstructorOptions? = definedExternally)

Types

Link copied to clipboard
external interface ConstructorOptions

Properties

Link copied to clipboard

An array of ParticleBurst, emitting bursts of particles at periodic times.

Link copied to clipboard
external var complete: DefaultEvent

Fires an event when the particle system has reached the end of its lifetime.

Link copied to clipboard
external var emissionRate: Int

The number of particles to emit per second.

Link copied to clipboard
external var emitter: ParticleEmitter

The particle emitter for this

Link copied to clipboard

The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.

Link copied to clipboard
external var endColor: Color

The color of the particle at the end of its life.

Link copied to clipboard
external var endScale: Double

The final scale to apply to the image of the particle at the end of its life.

Link copied to clipboard
external var image: JsAny

The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.

Link copied to clipboard
external var isComplete: Boolean

When true, the particle system has reached the end of its lifetime; false otherwise.

Link copied to clipboard
external var lifetime: Double

How long the particle system will emit particles, in seconds.

Link copied to clipboard
external var loop: Boolean

Whether the particle system should loop it's bursts when it is complete.

Link copied to clipboard

Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.

Link copied to clipboard
external var maximumMass: Double

Sets the maximum mass of particles in kilograms.

Link copied to clipboard

Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.

Link copied to clipboard
external var maximumSpeed: Double

Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.

Link copied to clipboard

Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.

Link copied to clipboard
external var minimumMass: Double

Sets the minimum mass of particles in kilograms.

Link copied to clipboard

Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.

Link copied to clipboard
external var minimumSpeed: Double

Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.

Link copied to clipboard
external var modelMatrix: Matrix4

The 4x4 transformation matrix that transforms the particle system from model to world coordinates.

Link copied to clipboard
external var show: Boolean

Whether to display the particle system.

Link copied to clipboard
external var sizeInMeters: Boolean

Gets or sets if the particle size is in meters or pixels. true to size particles in meters; otherwise, the size is in pixels.

Link copied to clipboard
external var startColor: Color

The color of the particle at the beginning of its life.

Link copied to clipboard
external var startScale: Double

The initial scale to apply to the image of the particle at the beginning of its life.

Link copied to clipboard

An array of force callbacks. The callback is passed a Particle and the difference from the last time

Functions

Link copied to clipboard
external fun destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

Link copied to clipboard
external fun isDestroyed(): Boolean

Returns true if this object was destroyed; otherwise, false.