Packageorg.flintparticles.threeD.actions
Classpublic class ApproachNeighbours
InheritanceApproachNeighbours Inheritance ActionBase

The ApproachNeighbours action applies an acceleration to the particle to draw it towards other nearby particles. The size of the acceleration is constant, only the direction varies.



Public Properties
 PropertyDefined by
  acceleration : Number
The acceleration force applied to approach the other particles.
ApproachNeighbours
  maxDistance : Number
The maximum distance, in pixels, over which this action operates.
ApproachNeighbours
Public Methods
 MethodDefined by
  
ApproachNeighbours(maxDistance:Number, acceleration:Number)
The constructor creates a ApproachNeighbours action for use by an emitter.
ApproachNeighbours
  
addedToEmitter(emitter:Emitter):void
This method does nothing.
ApproachNeighbours
  
Returns a value of 10, so that the ApproachNeighbours action executes before other actions.
ApproachNeighbours
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
Causes the particle to check all nearby particles and move towards their average position.
ApproachNeighbours
Property detail
accelerationproperty
acceleration:Number  [read-write]

The acceleration force applied to approach the other particles.

Implementation
    public function get acceleration():Number
    public function set acceleration(value:Number):void
maxDistanceproperty 
maxDistance:Number  [read-write]

The maximum distance, in pixels, over which this action operates. Particles further away than this distance are ignored.

Implementation
    public function get maxDistance():Number
    public function set maxDistance(value:Number):void
Constructor detail
ApproachNeighbours()constructor
public function ApproachNeighbours(maxDistance:Number, acceleration:Number)

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

Parameters
maxDistance:Number — The maximum distance, in pixels, over which this action operates. Particles further away than this distance are ignored.
 
acceleration:Number — The acceleration force applied to approach the other particles.

See also

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

This method does nothing. Some derived classes override this method to perform actions when the action is added to an emitter.

Parameters
emitter:Emitter — The Emitter that the Action was added to.
getDefaultPriority()method 
public override function getDefaultPriority():Number

Returns a value of 10, so that the ApproachNeighbours action executes before other actions.

Returns
Number

See also

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

Causes the particle to check all nearby particles and move towards their average position.

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