Packageorg.flintparticles.twoD.actions
Classpublic class TurnTowardsPoint
InheritanceTurnTowardsPoint Inheritance ActionBase Inheritance Object

The TurnTowardsPoint action causes the particle to constantly adjust its direction so that it travels towards a particular point.



Public Properties
 PropertyDefined By
  power : Number
The strength of the turn action.
TurnTowardsPoint
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  x : Number
The x coordinate of the point that the particle turns towards.
TurnTowardsPoint
  y : Number
The y coordinate of the point that the particle turns towards.
TurnTowardsPoint
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
TurnTowardsPoint(x:Number = 0, y:Number = 0, power:Number = 0)
The constructor creates a TurnTowardsPoint action for use by an emitter.
TurnTowardsPoint
 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 direction to the focus point and turns the particle towards this direction.
TurnTowardsPoint
Property Detail
powerproperty
power:Number

The strength of the turn action. Higher values produce a sharper turn.


Implementation
    public function get power():Number
    public function set power(value:Number):void
xproperty 
x:Number

The x coordinate of the point that the particle turns towards.


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number

The y coordinate of the point that the particle turns towards.


Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail
TurnTowardsPoint()Constructor
public function TurnTowardsPoint(x:Number = 0, y:Number = 0, power:Number = 0)

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

Parameters
x:Number (default = 0) — The strength of the turn action. Higher values produce a sharper turn.
 
y:Number (default = 0) — The x coordinate of the point towards which the particle turns.
 
power:Number (default = 0) — The y coordinate of the point towards which the particle turns.

See also

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

Calculates the direction to the focus point and turns the particle towards this direction.

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