System
The core of the three-system particle engine. A System instance can contain multiple emitters, each with their own initializers and behaviours.
Static Method Summary
Static Public Methods | ||
public static |
this method was deprecated. use fromJSONAsync instead
Creates a System instance from a JSON object. |
|
public static |
Loads a System instance from JSON asynchronously. |
Constructor Summary
Public Constructor | ||
public |
constructor(THREE: object, preParticles: number, integrationType: string): * Constructs a System instance. |
Member Summary
Public Members | ||
public |
Determines if the system can update or not. |
|
public |
The emitters in the particle system. |
|
public |
Internal event dispatcher |
|
public |
The integration algorithm type to use. |
|
public |
A pool used to manage the internal system cache of objects |
|
public |
The number of particles to start with. |
|
public |
renderers: array<Renderer> The renderers for the system. |
|
public |
The class type. |
Method Summary
Public Methods | ||
public |
addEmitter(emitter: Emitter): System Adds an emitter to the System instance. |
|
public |
addRenderer(renderer: Renderer): System Adds a renderer to the System instance and initializes it. |
|
public |
destroy(): * Destroys all emitters, renderers and the Nebula pool. |
|
public |
Proxy method for the internal event dispatcher's dispatchEvent method. |
|
public |
Wires up life cycle methods and causes a system's emitters to emit particles. Expects emitters to have their totalEmitTimes and life set already. Inifnite systems will resolve immediately. |
|
public |
getCount(): integer Gets a count of the total number of particles in the system. |
|
public |
removeEmitter(emitter: Emitter): System Removes an emitter from the System instance. |
|
public |
removeRenderer(renderer: Renderer): System Removes a renderer from the System instance. |
|
public |
Updates the particle system based on the delta passed. |
Static Public Methods
public static fromJSON(json: object, THREE: object): System source
Creates a System instance from a JSON object.
Public Constructors
Public Members
Public Methods
public addEmitter(emitter: Emitter): System source
Adds an emitter to the System instance. Dispatches the EMITTER_ADDED event.
Params:
Name | Type | Attribute | Description |
emitter | Emitter | The emitter to add |
public addRenderer(renderer: Renderer): System source
Adds a renderer to the System instance and initializes it.
Params:
Name | Type | Attribute | Description |
renderer | Renderer | The renderer to add |
public destroy(): * source
Destroys all emitters, renderers and the Nebula pool. Ensures that this.update will not perform any operations while the system is being destroyed.
Return:
* | void |
public dispatch(event: string, target: object<System|Emitter|Particle>) source
Proxy method for the internal event dispatcher's dispatchEvent method.
public emit(hooks: object): Promise source
Wires up life cycle methods and causes a system's emitters to emit particles. Expects emitters to have their totalEmitTimes and life set already. Inifnite systems will resolve immediately.
public getCount(): integer source
Gets a count of the total number of particles in the system.
Return:
integer |
public removeEmitter(emitter: Emitter): System source
Removes an emitter from the System instance. Dispatches the EMITTER_REMOVED event.
Params:
Name | Type | Attribute | Description |
emitter | Emitter | The emitter to remove |
public removeRenderer(renderer: Renderer): System source
Removes a renderer from the System instance.
Params:
Name | Type | Attribute | Description |
renderer | Renderer |