#include <particle.h>
Inheritance diagram for ChargedParticle:
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 Vector2d & | position () const |
void | setPosition (const Vector2d &position) |
const Vector2d & | velocity () const |
void | setVelocity (const Vector2d &velocity) |
const Vector2d & | force () 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) |
World * | world () const |
const QString & | name () const |
void | setName (const QString &name) |
ChargedParticle | ( | Vector2d | position = Vector2d(0.) , |
|
Vector2d | velocity = Vector2d(0.) , |
|||
double | mass = 1 , |
|||
double | charge = 0 | |||
) | [inline] |
Constructs a charged particle
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] |
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