Particle
Direct Subclass:
Indirect Subclass:
A Particle is an object that is emitted by an emitter.
Constructor Summary
Public Constructor | ||
public |
constructor(properties: object): * Constructs a Particle instance. |
Member Summary
Public Members | ||
public |
The particle's acceleration |
|
public |
The particle's age |
|
public |
The particle's alpha |
|
public |
behaviours: array The particle's behaviours array |
|
public |
The particle's body |
|
public |
The particle's color store |
|
public |
Determines if the particle is dead or not |
|
public |
The particle's distance to the camera, only set by the GPURenderer for depth sorting purposes. |
|
public |
The particle's easing |
|
public |
The particle's energy loss |
|
public |
The particle's unique id |
|
public |
The particle's life |
|
public |
The particle's mass |
|
public |
The particle's last position, velocity and acceleration |
|
public |
The particle's parent |
|
public |
The particle's position |
|
public |
The particle's radius |
|
public |
The particle's rotation |
|
public |
The particle's scale |
|
public |
Determines if the particle is sleeping or not |
|
public |
The particle's transform collection |
|
public |
The class type. |
|
public |
Determines whether to use alpha or not |
|
public |
Determines whether to use color or not |
|
public |
The particle's velocity |
Method Summary
Public Methods | ||
public |
addBehaviour(behaviour: Behaviour): * Adds a behaviour to the particle. |
|
public |
addBehaviours(behaviours: array<Behaviour>): * Adds multiple behaviours to the particle. |
|
public |
destroy(): * Destroys the particle. |
|
public |
Gets the particle's current direction. |
|
public |
removeAllBehaviours(): * Removes all behaviours from the particle. |
|
public |
removeBehaviour(behaviour: Behaviour): * Removes the behaviour from the particle. |
|
public |
Resets the particle's default properties and clear's its particle's position, velocity, acceleration, color and rotation. Also destroy's the particle's transform collection & removes all behaviours. |
|
public |
Updates the particle's properties by applying each behaviour to the particle. Will also update the particle's energy, unless it's age is greater than it's life in which case it will be destroyed. |
Public Constructors
public constructor(properties: object): * source
Constructs a Particle instance.
Params:
Name | Type | Attribute | Description |
properties | object | The properties to instantiate the particle with |
Return:
* | void |
Return Properties:
Name | Type | Attribute | Description |
properties.life | number | The particle's life |
|
properties.age | number | The particle's age |
|
properties.energy | number | The particle's energy loss |
|
properties.dead | boolean | Determines if the particle is dead or not |
|
properties.sleep | boolean | Determines if the particle is sleeping or not |
|
properties.target | object | The particle's target |
|
properties.body | object | The particle's body |
|
properties.mass | number | The particle's mass |
|
properties.radius | number | The particle's radius |
|
properties.alpha | number | The particle's alpha |
|
properties.scale | number | The particle's scale |
|
properties.rotation | number | The particle's rotation |
|
properties.color | string | number | The particle's color |
|
properties.easing | function | The particle's easing |
|
properties.position | Vector3D | The particle's position |
|
properties.velocity | Vector3D | The particle's velocity |
|
properties.acceleration | Vector3D | The particle's acceleration |
|
properties.behaviours | array | The particle's behaviours array |
|
properties.transform | object | The particle's transform collection |
Public Members
Public Methods
public addBehaviour(behaviour: Behaviour): * source
Adds a behaviour to the particle.
Params:
Name | Type | Attribute | Description |
behaviour | Behaviour | The behaviour to add to the particle |
Return:
* | void |
public addBehaviours(behaviours: array<Behaviour>): * source
Adds multiple behaviours to the particle.
Params:
Name | Type | Attribute | Description |
behaviours | array<Behaviour> | An array of behaviours to add to the particle |
Return:
* | void |
public removeBehaviour(behaviour: Behaviour): * source
Removes the behaviour from the particle.
Params:
Name | Type | Attribute | Description |
behaviour | Behaviour | The behaviour to remove from the particle |
Return:
* | void |
public reset(): Particle source
Resets the particle's default properties and clear's its particle's position, velocity, acceleration, color and rotation. Also destroy's the particle's transform collection & removes all behaviours.
public update(time: number, index: integer): * source
Updates the particle's properties by applying each behaviour to the particle. Will also update the particle's energy, unless it's age is greater than it's life in which case it will be destroyed.
Params:
Name | Type | Attribute | Description |
time | number | Integration time |
|
index | integer | Particle index |
Return:
* | void |