ChargedParticle Class Reference
[Physical bodies]

ChargedParticle with mass and charge. More...

#include <particle.h>

Inheritance diagram for ChargedParticle:

Particle Item Body Object List of all members.

Public Member Functions

 ChargedParticle (Vector2d position=Vector2d(0.), Vector2d velocity=Vector2d(0.), double mass=1, double charge=0)
double charge () const
void setCharge (double charge)
const Vector2dposition () const
void setPosition (const Vector2d &position)
const Vector2dvelocity () const
void setVelocity (const Vector2d &velocity)
const Vector2dforce () const
void setForce (const Vector2d &force)
void addForce (const Vector2d &force)
void zeroForce ()
double mass () const
void setMass (double mass)
int variablesCount ()
void resetDerivatives ()
void getDerivatives (double *array)
void getVariables (double *array)
void setVariables (const double *array)
virtual void worldItemRemoved (Item *item)
virtual void setWorld (World *world)
Worldworld () const
const QString & name () const
void setName (const QString &name)

Detailed Description

ChargedParticle with mass and charge.


Constructor & Destructor Documentation

ChargedParticle ( Vector2d  position = Vector2d(0.),
Vector2d  velocity = Vector2d(0.),
double  mass = 1,
double  charge = 0 
) [inline]

Constructs a charged particle


Member Function Documentation

double charge (  )  const [inline]

Charge of the particle

void setCharge ( double  charge  )  [inline]

Charge of the particle

const Vector2d& position (  )  const [inline, inherited]

Get position of the particle

void setPosition ( const Vector2d position  )  [inline, inherited]

Set position of the particle

const Vector2d& velocity (  )  const [inline, inherited]

Get velocity of the particle

void setVelocity ( const Vector2d velocity  )  [inline, inherited]

Set velocity of the particle

const Vector2d& force (  )  const [inline, inherited]

Get force that acts upon particle

void setForce ( const Vector2d force  )  [inline, inherited]

Set force that acts upon particle

void addForce ( const Vector2d force  )  [inline, inherited]

Increment force

void zeroForce (  )  [inline, inherited]

Reset force to zero

double mass (  )  const [inline, inherited]

Get mass of the particle

void setMass ( double  mass  )  [inline, inherited]

Set mass of the particle

int variablesCount (  )  [inline, virtual, inherited]

Get count of dynamic variables

Implements Body.

void resetDerivatives (  )  [virtual, inherited]

Resets derivatives of dynamic variables to zero

Implements Body.

void getDerivatives ( double *  array  )  [virtual, inherited]

Copies derivatives of dynamic variables to array

Implements Body.

void getVariables ( double *  array  )  [virtual, inherited]

Copies dynamic variables to array

Implements Body.

void setVariables ( const double *  array  )  [virtual, inherited]

Set dynamic variables using values in array

Implements Body.

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 file:
Generated on Thu Mar 15 14:23:37 2007 for StepCore by  doxygen 1.5.1