| Package | org.flintparticles.actions |
| Class | public class Collide |
| Inheritance | Collide Action |
If the particles reach a stationary, or near stationary, state under an accelerating force (e.g. gravity) then they will fall through each other. This is due to the nature of the alogorithm used, which is designed for speed of execution and sufficient accuracy when the particles are in motion, not for absolute precision.
| Property | Defined by | ||
|---|---|---|---|
| bounce : Number
The coefficient of restitution when the particles collide.
| Collide | ||
| radius : Number
The radius of a particle used when calculating the collisions.
| Collide | ||
| Method | Defined by | ||
|---|---|---|---|
|
Collide(radius:Number, bounce:Number = 1)
The constructor creates a Collide action for use by an emitter.
| Collide | ||
|
addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Action is added to it
It is called within the emitter's addAction method and need not
be called by the user.
| Collide | ||
|
getDefaultPriority():Number
The getDefaultPriority method is used to order the execution of actions.
| Collide | ||
![]() |
removedFromEmitter(emitter:Emitter):void
The removedFromEmitter method is called by the emitter when the Action is removed from it
It is called within the emitter's removeAction method and need not
be called by the user.
| Action | |
|
The update method is used by the emitter to apply the action
to every particle.
| Collide | ||
| bounce | property |
bounce:Number [read-write]The coefficient of restitution when the particles collide. A value of 1 gives a pure elastic collision, with no energy loss. A value between 0 and 1 causes the particle to loose enegy in the collision. A value greater than 1 causes the particle to gain energy in the collision.
Implementation public function get bounce():Number
public function set bounce(value:Number):void
| radius | property |
radius:Number [read-write]The radius of a particle used when calculating the collisions. this radius is multiplied by the scale property of each particle to get the particle's actual size and relative mass for calculating the collision and response.
Implementation public function get radius():Number
public function set radius(value:Number):void
| Collide | () | constructor |
public function Collide(radius:Number, bounce:Number = 1)The constructor creates a Collide action for use by an emitter. To add a Collide to all particles created by an emitter, use the emitter's addAction method.
Parametersradius:Number — The radius of a particle used when calculating the collisions. this
radius is multiplied by the scale property of each particle to get the particle's
actual size and relative mass for calculating the collision and response.
|
|
bounce:Number (default = 1) — The coefficient of restitution when the particles collide. A value of
1 gives a pure elastic collision, with no energy loss. A value
between 0 and 1 causes the particle to loose enegy in the collision. A value greater
than 1 causes the particle to gain energy in the collision.
|
See also
| addedToEmitter | () | method |
public override function addedToEmitter(emitter:Emitter):voidThe addedToEmitter method is called by the emitter when the Action is added to it It is called within the emitter's addAction method and need not be called by the user.
Parametersemitter:Emitter — The Emitter that the Action was added to.
|
| getDefaultPriority | () | method |
public override function getDefaultPriority():NumberThe getDefaultPriority method is used to order the execution of actions. It is called within the emitter's addAction method when the user doesn't manually set a priority. It need not be called directly by the user.
ReturnsNumber |
| update | () | method |
public override function update(emitter:Emitter, particle:Particle, time:Number):voidThe update method is used by the emitter to apply the action to every particle. It is called within the emitter's update loop and need not be called by the user.
Parametersemitter:Emitter — The Emitter that created the particle.
|
|
particle:Particle — The particle to be updated.
|
|
time:Number — The duration of the frame - used for time based updates.
|