Packageorg.flintparticles.twoD.actions
Classpublic class MatchRotateVelocity
InheritanceMatchRotateVelocity Inheritance ActionBase Inheritance Object

The MatchRotateVelocity action applies an angular acceleration to each particle to match its angular velocity to that of its nearest neighbours.

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



Public Properties
 PropertyDefined By
  acceleration : Number
The angular acceleration applied to adjust the angular velocity to match that of the other particles.
MatchRotateVelocity
  maxDistance : Number
The maximum distance, in pixels, over which this action operates.
MatchRotateVelocity
 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
  
MatchRotateVelocity(maxDistance:Number = 0, acceleration:Number = 0)
The constructor creates a MatchRotateVelocity action for use by an emitter.
MatchRotateVelocity
  
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.
MatchRotateVelocity
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Checks all particles near the current particle and applies the angular acceleration to alter the particle's angular velocity towards their average angular velocity.
MatchRotateVelocity
Property Detail
accelerationproperty
acceleration:Number

The angular acceleration applied to adjust the angular velocity to match that of the other particles.


Implementation
    public function get acceleration():Number
    public function set acceleration(value:Number):void
maxDistanceproperty 
maxDistance:Number

The maximum distance, in pixels, over which this action operates. The particle will match its angular velocity other particles that are at most this close to it.


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

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

Parameters
maxDistance:Number (default = 0) — The maximum distance, in pixels, over which this action operates. The particle will match its angular velocity to other particles that are at most this close to it.
 
acceleration:Number (default = 0) — The angular acceleration applied to adjust the angular velocity to match that of 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 all particles near the current particle and applies the angular acceleration to alter the particle's angular velocity towards their average angular velocity.

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