| Property | Defined by | ||
|---|---|---|---|
| g : Number gravitational constant
| GravitationalForceGenerator | ||
| source : ISimulatable
source of gravitational pull (references mass)
| GravitationalForceGenerator | ||
| Method | Defined by | ||
|---|---|---|---|
|
GravitationalForceGenerator(source:ISimulatable, gravitationalConstant:Number = 1.2)
Creates the Force Generator
| GravitationalForceGenerator | ||
|
generate(element:ISimulatable):void
Generates the gravitational force on the supplied element
We find the source through the following equation: F = G m1 m2 / r^2where: F is the force we're solving for (applied along the bodies' difference vector) G is a gravitational constant m1/m2 are the masses involved in the exchange (here, the force is only applied to element) r is the distance between the bodies | GravitationalForceGenerator | ||
| g | property |
protected var g:Numbergravitational constant
| source | property |
protected var source:ISimulatablesource of gravitational pull (references mass)
| GravitationalForceGenerator | () | constructor |
public function GravitationalForceGenerator(source:ISimulatable, gravitationalConstant:Number = 1.2)Creates the Force Generator
Parameterssource:ISimulatable — source of gravitational pull
|
|
gravitationalConstant:Number (default = 1.2) — magic constant (trial and error per simulation)
|
— if source has infinite mass
|
| generate | () | method |
public function generate(element:ISimulatable):voidGenerates the gravitational force on the supplied element
We find the source through the following equation:
F = G m1 m2 / r^2where:
F is the force we're solving for (applied along the bodies' difference vector) G is a gravitational constant m1/m2 are the masses involved in the exchange (here, the force is only applied to element) r is the distance between the bodiesParameters
element:ISimulatable — ISimulatable to apply force to
|