WeightForce Class Reference
[Physical forces]

Weight force (constant gravitational force). More...

#include <gravitation.h>

Inheritance diagram for WeightForce:

Item Force Object List of all members.

Public Member Functions

 WeightForce (double weightConst=Constants::WeightAccel)
void calcForce ()
double weightConst () const
void setWeightConst (double weightConst)
virtual void worldItemRemoved (Item *item)
virtual void setWorld (World *world)
Worldworld () const
const QString & name () const
void setName (const QString &name)

Detailed Description

Weight force (constant gravitational force).

The force acts between on massive bodies (currently only Particle) and equals:

\[ \overrightarrow{f} = \left( \begin{array}{c} 0 \\ mg \end{array} \right) \]

where:
$m$ is Particle::mass
$g$ is WeightForce::weightConst

Todo:
Add interface for massive bodies, support bodies with distributed mass


Constructor & Destructor Documentation

WeightForce ( double  weightConst = Constants::WeightAccel  ) 

Constructs WeightForce


Member Function Documentation

void calcForce (  )  [virtual]

Calculate force. Bodies can be accessed through this->world()->bodies()

Implements Force.

double weightConst (  )  const [inline]

Get weight constant

void setWeightConst ( double  weightConst  )  [inline]

Set weight constant

virtual void worldItemRemoved ( Item item  )  [inline, virtual, inherited]

Called by the World when any item is removed from the world

Parameters:
item Pointer to removed item
Todo:
XXX rename

Reimplemented in Spring.

virtual void setWorld ( World world  )  [inline, virtual, inherited]

Set/change pointer to World in which this object lives

Reimplemented in Spring.

World* world (  )  const [inline, inherited]

Get pointer to World in which this object lives

Returns:
Pointer to the World or NULL

const QString& name (  )  const [inline, inherited]

Returns name of the object

void setName ( const QString &  name  )  [inline, inherited]

Set name of the object


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 14:23:37 2007 for StepCore by  doxygen 1.5.1