Packageorg.flintparticles.threeD.actions
Classpublic class MutualGravity
InheritanceMutualGravity Inheritance ActionBase Inheritance Object

The MutualGravity Action applies forces to attract each particle towards the other particles.

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



Public Properties
 PropertyDefined By
  epsilon : Number
The minimum distance for which the gravity force is calculated.
MutualGravity
  maxDistance : Number
The maximum distance between particles for the gravitational effect to be calculated.
MutualGravity
  power : Number
The strength of the gravity force.
MutualGravity
 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
  
MutualGravity(power:Number = 0, maxDistance:Number = 0, epsilon:Number = 1)
The constructor creates a MutualGravity action for use by an emitter.
MutualGravity
  
addedToEmitter(emitter:Emitter):void
[override] This method does nothing.
MutualGravity
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] This method does nothing.
MutualGravity
Property Detail
epsilonproperty
epsilon:Number

The minimum distance for which the gravity force is calculated. Particles closer than this distance experience the gravity as it they were this distance away. This stops the gravity effect blowing up as distances get small.


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

The maximum distance between particles for the gravitational effect to be calculated. You can speed up this action by reducing the maxDistance since often only the closest other particles have a significant effect on the motion of a particle.


Implementation
    public function get maxDistance():Number
    public function set maxDistance(value:Number):void
powerproperty 
power:Number

The strength of the gravity force.


Implementation
    public function get power():Number
    public function set power(value:Number):void
Constructor Detail
MutualGravity()Constructor
public function MutualGravity(power:Number = 0, maxDistance:Number = 0, epsilon:Number = 1)

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

Parameters
power:Number (default = 0) — The strength of the gravitational pull between the particles.
 
maxDistance:Number (default = 0) — The maximum distance between particles for the gravitational effect to be calculated. You can speed up this action by reducing the maxDistance since often only the closest other particles have a significant effect on the motion of a particle.
 
epsilon:Number (default = 1)

See also

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

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

This method does nothing. All derived classes override this method to update each particle every frame.

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.