Table Of Contents

Previous topic

20.7. The ParticleRenderer Interface

Next topic

20.9. The ParticleEmitter Interface

This Page

20.8. The ParticleSynchronizer Interface

Added SDK 0.28.0

Represents how a particle system is synchronized, including emitting new particles.


This is a low-level particle system API.

20.8.1. Methods synchronize


The synchronize function will be called via the ParticleSystem sync method, itself called from the ParticleRenderables referencing the system.

This function is required to update the particle system, and emit any new particles for simulation. This method should make use of the beginUpdate, createParticle, endUpdate and tracked-particle methods.


The ParticleSystem being synchronized.
The amount of time (as determined by the particle system timer) that has elapsed since the last synchronization. addEmitter


Add a ParticleEmitter to the synchronizer.


synchronizer.addEmitter(emitter); removeEmitter


Remove a ParticleEmitter from the synchronizer.


synchronizer.removeEmitter(emitter); reset


Reset synchronizer object, removing all its emitters in the process.


synchronizer.reset(); applyArchetype


Apply synchronizer specific archetype parameters to this archetype. This is used by the ParticleManager.


The synchronizer specific archetype parameters to be applied.

20.8.2. Properties emitters


Set of ParticleEmitters added to the synchronizer


Read Only renderable


The ParticleRenderable to be tracked for formation of particle trails in the system synchronized by this synchronizer.


Read Only

20.8.3. The DefaultParticleSynchronizer Object

An implementation of the ParticleSynchronizer interface supporting variable or fixed-time step synchronization, with particles emitted by a set of emitter objects supporting a time-ordered event queue for complex emitter effects. Methods create


Create a new default synchronizer object.


var synchronizer = DefaultParticleSynchronizer.create({
    fixedTimeStep: 1/60,
    maxSubSteps: 4,
    renderable: null,
    trailFollow: 0.5
fixedTimeStep (Optional)
A fixed time step in seconds to use for particle system updates, if unspecified then a variable time step will be used instead based on elapsed time.
maxSubSteps (Optional)
Default value 3. The maximum amount of particle system updates to perform in any synchronization when using a fixed time step.If the number of fixed time steps required exceeds this amount, then the synchronizer will move to a variable time step for that synchronization event, performing exactly maxSubSteps updates.
renderable (Optional)
The ParticleRenderable associated with the particle system to which this synchronizer is attached. This need not be specified (and can be set later), but is required if you want trails to form when the renderable is moved in the Scene.
trailFollow (Optional)

A value specifying how trails form when a renderable has been specified.

A trailFollow of 1, specifies that an exact trail forms, with already emitted particles appearing to be unaffected by movement of the system.

A trailFollow of 0, specifies that no trail should form and already emitted particles will follow the movements of the system exactly.

The default value is 1. enqueue


Enqueue an event object to the synchronizer for processing.




The event to enqueue. An event is an object with the following fields:

A number specifying the relative time until the event should take place. Example a time of 1 would specify the event should happen in 1 second from the present time.

A function to be called when the event occurs, this function will be called with the following parameters:

The event being processed.
The synchronizer object the event relates to.
The ParticleSystem the synchronizer is working with.
A function to be called to recycle an event object when the synchronizer is reset. This will not be called otherwise, and the normal fun function should deal with recycling in ordinary circumstances. Properties

These properties are the same as those parameters supported for a ParticleArchetype using this synchronizer unless otherwise specified. fixedTimeStep

The fixed time step to be used for updating the system, this value may be set null to move back to a variable time step. maxSubSteps

The maximum amount of sub-steps to make when updating the system if using a fixed time step. trailFollow

The number specifying how trails form, with 1 specifying a standard trail, and 0 specifying that already emitted particles will follow the movements of the system without trails forming. Any value is permitted, though values between 0 and 1 are ‘expected’.