Packageflare.physics
Classpublic class GravityForce
ImplementsIForce

Force simulating a global gravitational pull on Particle instances.



Public Properties
 PropertyDefined by
  gravityX : Number
The gravitational acceleration in the horizontal dimension.
GravityForce
  gravityY : Number
The gravitational acceleration in the vertical dimension.
GravityForce
Public Methods
 MethodDefined by
  
GravityForce(gx:Number = 0, gy:Number = 0)
Creates a new gravity force with given acceleration values.
GravityForce
  
apply(sim:Simulation):void
Applies this force to a simulation.
GravityForce
Property detail
gravityXproperty
gravityX:Number  [read-write]

The gravitational acceleration in the horizontal dimension.

Implementation
    public function get gravityX():Number
    public function set gravityX(value:Number):void
gravityYproperty 
gravityY:Number  [read-write]

The gravitational acceleration in the vertical dimension.

Implementation
    public function get gravityY():Number
    public function set gravityY(value:Number):void
Constructor detail
GravityForce()constructor
public function GravityForce(gx:Number = 0, gy:Number = 0)

Creates a new gravity force with given acceleration values.

Parameters
gx:Number (default = 0) — the gravitational acceleration in the horizontal dimension
 
gy:Number (default = 0) — the gravitational acceleration in the vertical dimension
Method detail
apply()method
public function apply(sim:Simulation):void

Applies this force to a simulation.

Parameters
sim:Simulation — the Simulation to apply the force to