| Package | org.flintparticles.twoD.actions |
| Class | public class GravityWell |
| Inheritance | GravityWell ActionBase |
| Subclasses | AntiGravity |
This simulates the effect of gravity over large distances (as between planets, for example). To simulate the effect of gravity at the surface of the eacrth, use an Acceleration action with the direction of force downwards.
See also
| Property | Defined by | ||
|---|---|---|---|
| epsilon : Number
The minimum distance for which the gravity force is calculated.
| GravityWell | ||
| power : Number
The strength of the gravity force - larger numbers produce a
stronger force.
| GravityWell | ||
![]() | priority : int
Returns a default priority of 0 for this action.
| ActionBase | |
| x : Number
The x coordinate of the point towards which the force draws
the particles.
| GravityWell | ||
| y : Number
The y coordinate of the point towards which the force draws
the particles.
| GravityWell | ||
| Method | Defined by | ||
|---|---|---|---|
|
GravityWell(power:Number = 0, x:Number = 0, y:Number = 0, epsilon:Number = 100)
The constructor creates a GravityWell action for use by an emitter.
| GravityWell | ||
![]() |
addedToEmitter(emitter:Emitter):void
This method does nothing.
| ActionBase | |
![]() |
removedFromEmitter(emitter:Emitter):void
This method does nothing.
| ActionBase | |
|
Calculates the gravity force on the particle and applies it for
the period of time indicated.
| GravityWell | ||
| epsilon | property |
epsilon:Number [read-write]The minimum distance for which the gravity force is calculated. Particles closer than this distance experience the gravity as if they were this distance away. This stops the gravity effect blowing up as distances get small. For realistic gravity effects you will want a small epsilon ( ~1 ), but for stable visual effects a larger epsilon (~100) is often better.
Implementation public function get epsilon():Number
public function set epsilon(value:Number):void
| power | property |
power:Number [read-write]The strength of the gravity force - larger numbers produce a stronger force.
Implementation public function get power():Number
public function set power(value:Number):void
| x | property |
x:Number [read-write]The x coordinate of the point towards which the force draws the particles.
Implementation public function get x():Number
public function set x(value:Number):void
| y | property |
y:Number [read-write]The y coordinate of the point towards which the force draws the particles.
Implementation public function get y():Number
public function set y(value:Number):void
| GravityWell | () | constructor |
public function GravityWell(power:Number = 0, x:Number = 0, y:Number = 0, epsilon:Number = 100)The constructor creates a GravityWell action for use by an emitter. To add a GravityWell to all particles created by an emitter, use the emitter's addAction method.
Parameterspower:Number (default = 0) — The strength of the gravity force - larger numbers produce a
stronger force.
|
|
x:Number (default = 0) — The x coordinate of the point towards which the force draws
the particles.
|
|
y:Number (default = 0) — The y coordinate of the point towards which the force draws
the particles.
|
|
epsilon:Number (default = 100) — The minimum distance for which gravity is calculated.
Particles closer than this distance experience a gravity force as if
they were this distance away. This stops the gravity effect blowing
up as distances get small. For realistic gravity effects you will want
a small epsilon ( ~1 ), but for stable visual effects a larger
epsilon (~100) is often better.
|
See also
| update | () | method |
public override function update(emitter:Emitter, particle:Particle, time:Number):voidCalculates the gravity force on the particle and applies it for the period of time indicated.
This method is called by the emitter and need not be called by the user.
Parametersemitter: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