Packageorg.flintparticles.twoD.actions
Classpublic class TargetVelocity
InheritanceTargetVelocity Inheritance ActionBase Inheritance Object

The TargetVelocity action adjusts the velocity of the particle towards the target velocity.



Public Properties
 PropertyDefined By
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  rate : Number
Adjusts how quickly the particle reaches the target velocity.
TargetVelocity
  targetVelocityX : Number
The x coordinate of the target velocity, in pixels per second.s
TargetVelocity
  targetVelocityY : Number
The y coordinate of the target velocity, in pixels per second.
TargetVelocity
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
TargetVelocity(targetVelocityX:Number = 0, targetVelocityY:Number = 0, rate:Number = 0.1)
The constructor creates a TargetVelocity action for use by an emitter.
TargetVelocity
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Calculates the difference between the particle's velocity and the target and adjusts the velocity closer to the target by an amount proportional to the difference, the time and the rate of convergence.
TargetVelocity
Property Detail
rateproperty
rate:Number

Adjusts how quickly the particle reaches the target velocity. Larger numbers cause it to approach the target velocity more quickly.


Implementation
    public function get rate():Number
    public function set rate(value:Number):void
targetVelocityXproperty 
targetVelocityX:Number

The x coordinate of the target velocity, in pixels per second.s


Implementation
    public function get targetVelocityX():Number
    public function set targetVelocityX(value:Number):void
targetVelocityYproperty 
targetVelocityY:Number

The y coordinate of the target velocity, in pixels per second.


Implementation
    public function get targetVelocityY():Number
    public function set targetVelocityY(value:Number):void
Constructor Detail
TargetVelocity()Constructor
public function TargetVelocity(targetVelocityX:Number = 0, targetVelocityY:Number = 0, rate:Number = 0.1)

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

Parameters
targetVelocityX:Number (default = 0) — The x coordinate of the target velocity, in pixels per second.
 
targetVelocityY:Number (default = 0) — The y coordinate of the target velocity, in pixels per second.
 
rate:Number (default = 0.1) — Adjusts how quickly the particle reaches the target velocity. Larger numbers cause it to approach the target velocity more quickly.

See also

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

Calculates the difference between the particle's velocity and the target and adjusts the velocity closer to the target by an amount proportional to the difference, the time and the rate of convergence.

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