| Package | org.flintparticles.threeD.actions |
| Class | public class Collide |
| Inheritance | Collide ActionBase |
| Implements | FrameUpdatable |
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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
Collide(bounce:Number = 1)
The constructor creates a Collide action for use by an emitter.
| Collide | ||
|
addedToEmitter(emitter:Emitter):void
Instructs the emitter to produce a sorted particle array for optimizing
the calculations in the update method of this action and
adds an UpdateOnFrame activity to the emitter to call this objects
frameUpdate method once per frame.
| Collide | ||
|
frameUpdate(emitter:Emitter, time:Number):void
Called every frame before the particles are updated, this method
calculates the collision radius of the largest two particles, which
aids in optimizing the collision calculations.
| Collide | ||
|
getDefaultPriority():Number
Returns a default priority of 0 for this action.
| Collide | ||
|
removedFromEmitter(emitter:Emitter):void
Removes the UpdateOnFrame activity that was added to the emitter in the
addedToEmitter method.
| Collide | ||
|
This method does nothing.
| 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
| Collide | () | constructor |
public function Collide(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.
Parametersbounce: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):voidInstructs the emitter to produce a sorted particle array for optimizing the calculations in the update method of this action and adds an UpdateOnFrame activity to the emitter to call this objects frameUpdate method once per frame.
Parametersemitter:Emitter — The emitter this action has been added to.
|
See also
| frameUpdate | () | method |
public function frameUpdate(emitter:Emitter, time:Number):voidCalled every frame before the particles are updated, this method calculates the collision radius of the largest two particles, which aids in optimizing the collision calculations.
This method is called using an UpdateOnFrame activity that is created in the addedToEmitter method.
Parametersemitter:Emitter — The emitter that is using this action.
|
|
time:Number — The duration of the current animation frame.
|
See also
| getDefaultPriority | () | method |
public override function getDefaultPriority():NumberReturns a default priority of 0 for this action. Derived classes override this method if they want a different default priority.
ReturnsNumber |
| removedFromEmitter | () | method |
public override function removedFromEmitter(emitter:Emitter):voidRemoves the UpdateOnFrame activity that was added to the emitter in the addedToEmitter method.
Parametersemitter:Emitter — The emitter this action has been added to.
|
See also
| update | () | method |
public override function update(emitter:Emitter, particle:Particle, time:Number):voidThis method does nothing. All derived classes override this method to update each particle every frame.
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.
|