Packageorg.flintparticles.actions
Classpublic class MatchVelocity
InheritanceMatchVelocity Inheritance Action

The MatchVelocity action applies an acceleration to the particle to match its velocity to that of its nearest neighbours.



Public Properties
 PropertyDefined by
  acceleration : Number
The acceleration force applied to adjust velocity to match that of the other particles.
MatchVelocity
  maxDistance : Number
The maximum distance, in pixels, over which this action operates.
MatchVelocity
Public Methods
 MethodDefined by
  
MatchVelocity(maxDistance:Number, acceleration:Number)
The constructor creates a MatchVelocity action for use by an emitter.
MatchVelocity
  
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.
MatchVelocity
  
The getDefaultPriority method is used to order the execution of actions.
MatchVelocity
 Inherited
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
  
update(emitter:Emitter, particle:Particle, time:Number):void
The update method is used by the emitter to apply the action to every particle.
MatchVelocity
Property detail
accelerationproperty
acceleration:Number  [read-write]

The acceleration force applied to adjust velocity to match that of 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. The particle will match its velocity other particles that are this close or closer to it.

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

The constructor creates a MatchVelocity action for use by an emitter. To add a MatchVelocity 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. The particle will match its velocity other particles that are this close or closer to it.
 
acceleration:Number — The acceleration force applied to adjust velocity to match that of the other particles.

See also

Method detail
addedToEmitter()method
public override function 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.

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

The 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.

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

The 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.

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.