new Group(options)
The SPE.Group class. Creates a new group, containing a material, geometry, and mesh.
Parameters:
Name | Type | Description |
---|---|---|
options |
GroupOptions | A map of options to configure the group instance. |
- Source:
Methods
addEmitter(emitter)
Adds an SPE.Emitter instance to this group, creating particle values and
assigning them to this group's shader attributes.
Parameters:
Name | Type | Description |
---|---|---|
emitter |
Emitter | The emitter to add to this group. |
- Source:
addPool(numEmitters, emitterOptions, createNew) → {Group}
Add a pool of emitters to this particle group
Parameters:
Name | Type | Description |
---|---|---|
numEmitters |
Number | The number of emitters to add to the pool. |
emitterOptions |
EmitterOptions | 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? |
- Source:
Returns:
This group instance.
- Type
- Group
dispose() → {Group}
Dipose the geometry and material for the group.
- Source:
Returns:
Group instance.
- Type
- Group
getFromPool() → {Emitter|null}
Fetch a single emitter instance from the pool.
If there are no objects in the pool, a new emitter will be
created if specified.
- Source:
Returns:
- Type
- Emitter | null
getPool() → {Array}
Get the pool array
- Source:
Returns:
- Type
- Array
releaseIntoPool(emitter) → {Group}
Release an emitter into the pool.
Parameters:
Name | Type | Description |
---|---|---|
emitter |
ShaderParticleEmitter |
- Source:
Returns:
This group instance.
- Type
- Group
removeEmitter(emitter)
Removes an SPE.Emitter instance from this group. When called,
all particle's belonging to the given emitter will be instantly
removed from the scene.
Parameters:
Name | Type | Description |
---|---|---|
emitter |
Emitter | The emitter to add to this group. |
- Source:
tick(dtopt)
Simulate all the emitter's belonging to this group, updating
attribute values along the way.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dt |
Number |
<optional> |
Group's `fixedTimeStep` value | The number of seconds to simulate the group's emitters for (deltaTime) |
- Source:
triggerPoolEmitter(numEmitters, positionopt) → {Group}
Set a given number of emitters as alive, with an optional position
vector3 to move them to.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
numEmitters |
Number | The number of emitters to activate | |
position |
Object |
<optional> |
A THREE.Vector3 instance describing the position to activate the emitter(s) at. |
- Source:
Returns:
This group instance.
- Type
- Group