Packageorg.flintparticles.twoD.actions
Classpublic class MinimumDistance
InheritanceMinimumDistance Inheritance ActionBase Inheritance Object

The MinimumDistance action applies an acceleration to the particle to maintain a minimum distance between it and its neighbours.

This action has a priority of 10, so that it executes before other actions.



Public Properties
 PropertyDefined By
  acceleration : Number
The acceleration force applied to avoid the other particles.
MinimumDistance
  minimum : Number
The minimum distance, in pixels, that this action maintains between particles.
MinimumDistance
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
MinimumDistance(minimum:Number = 0, acceleration:Number = 0)
The constructor creates a MinimumDistance action for use by an emitter.
MinimumDistance
  
addedToEmitter(emitter:Emitter):void
[override] Instructs the emitter to produce a sorted particle array for optimizing the calculations in the update method of this action.
MinimumDistance
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Checks for particles closer than the minimum distance to the current particle and if any are found applies the acceleration to move the particles apart.
MinimumDistance
Property Detail
accelerationproperty
acceleration:Number

The acceleration force applied to avoid the other particles.


Implementation
    public function get acceleration():Number
    public function set acceleration(value:Number):void
minimumproperty 
minimum:Number

The minimum distance, in pixels, that this action maintains between particles.


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
Constructor Detail
MinimumDistance()Constructor
public function MinimumDistance(minimum:Number = 0, acceleration:Number = 0)

The constructor creates a MinimumDistance action for use by an emitter. To add a MinimumDistance to all particles created by an emitter, use the emitter's addAction method.

Parameters
minimum:Number (default = 0) — The minimum distance, in pixels, that this action maintains between particles.
 
acceleration:Number (default = 0) — The acceleration force applied to avoid the other particles.

See also

Method Detail
addedToEmitter()method
override public function addedToEmitter(emitter:Emitter):void

Instructs the emitter to produce a sorted particle array for optimizing the calculations in the update method of this action.

Parameters

emitter:Emitter — The emitter this action has been added to.

See also

update()method 
override public function update(emitter:Emitter, particle:Particle, time:Number):void

Checks for particles closer than the minimum distance to the current particle and if any are found applies the acceleration to move the particles apart.

This method is called by the emitter and need not be called by the user.

Parameters

emitter: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.

See also