#include <gravitation.h>
Inheritance diagram for GravitationForce:
Public Member Functions | |
GravitationForce (double gravitationConst=Constants::Gravitational) | |
void | calcForce () |
double | gravitationConst () const |
void | setGravitationConst (double gravitationConst) |
virtual void | worldItemRemoved (Item *item) |
virtual void | setWorld (World *world) |
World * | world () const |
const QString & | name () const |
void | setName (const QString &name) |
The force acts between pairs of massive bodies (currently only Particle) and equals:
where:
is GravitationForce::gravitationConst
and is Particle::mass of first and second body
is difference of Particle::position of the first and second body
GravitationForce | ( | double | gravitationConst = Constants::Gravitational |
) |
Constructs GravitationForce
void calcForce | ( | ) | [virtual] |
double gravitationConst | ( | ) | const [inline] |
Get gravitational constant
void setGravitationConst | ( | double | gravitationConst | ) | [inline] |
Set gravitational constant
virtual void worldItemRemoved | ( | Item * | item | ) | [inline, virtual, inherited] |
virtual void setWorld | ( | World * | world | ) | [inline, virtual, inherited] |
World* world | ( | ) | const [inline, inherited] |
const QString& name | ( | ) | const [inline, inherited] |
Returns name of the object
void setName | ( | const QString & | name | ) | [inline, inherited] |
Set name of the object