RigidBody Class Reference
[Physical bodies]

Rigid body. More...

#include <rigidbody.h>

Inheritance diagram for RigidBody:

Item Body Object Polygon List of all members.

Public Member Functions

 RigidBody (Vector2d position=Vector2d(0), double angle=0, Vector2d velocity=Vector2d(0), double angularVelocity=0, double mass=1, double inertia=1)
const Vector2dposition () const
void setPosition (const Vector2d &position)
double angle () const
void setAngle (double angle)
const Vector2dvelocity () const
void setVelocity (const Vector2d &velocity)
double angularVelocity () const
void setAngularVelocity (double angularVelocity)
const Vector2dforce () const
void setForce (const Vector2d &force)
double torque () const
void setTorque (double torque)
void applyForce (Vector2d force, Vector2d position)
void applyTorque (double torque)
double mass () const
void setMass (double mass)
double inertia () const
void setInertia (double inertia)
Vector2d pointLocalToWorld (const Vector2d &p)
Vector2d pointWorldToLocal (const Vector2d &p)
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

Rigid body.


Constructor & Destructor Documentation

RigidBody ( Vector2d  position = Vector2d(0),
double  angle = 0,
Vector2d  velocity = Vector2d(0),
double  angularVelocity = 0,
double  mass = 1,
double  inertia = 1 
)

Constructs RigidBody


Member Function Documentation

const Vector2d& position (  )  const [inline]

Get position of the center of mass of the body

void setPosition ( const Vector2d position  )  [inline]

Set position of the center of mass of the body

double angle (  )  const [inline]

Get angle of the body

void setAngle ( double  angle  )  [inline]

Set angle of the body

const Vector2d& velocity (  )  const [inline]

Get velocity of the center of mass of the body

void setVelocity ( const Vector2d velocity  )  [inline]

Set velocity of the particle

double angularVelocity (  )  const [inline]

Get angular velocity of the body

void setAngularVelocity ( double  angularVelocity  )  [inline]

Set angular velocity of the body

const Vector2d& force (  )  const [inline]

Get force that acts upon the body

void setForce ( const Vector2d force  )  [inline]

Set force that acts upon the body

double torque (  )  const [inline]

Get torque that acts upon the body

void setTorque ( double  torque  )  [inline]

Set torque that acts upon the body

void applyForce ( Vector2d  force,
Vector2d  position 
)

Apply force to the body at given position (in World coordinates)

void applyTorque ( double  torque  ) 

Apply torque to the body

double mass (  )  const [inline]

Get mass of the body

void setMass ( double  mass  )  [inline]

Set mass of the body

double inertia (  )  const [inline]

Get inertia "tensor" of the body

void setInertia ( double  inertia  )  [inline]

Set inertia "tensor" of the body

Vector2d pointLocalToWorld ( const Vector2d p  ) 

Translate local coordinates on body to world coordinates

Vector2d pointWorldToLocal ( const Vector2d p  ) 

Translate world coordinates to local coordinates on body

int variablesCount (  )  [inline, virtual]

Get count of dynamic variables

Implements Body.

void resetDerivatives (  )  [virtual]

Resets derivatives of dynamic variables to zero

Implements Body.

void getDerivatives ( double *  array  )  [virtual]

Copies derivatives of dynamic variables to array

Implements Body.

void getVariables ( double *  array  )  [virtual]

Copies dynamic variables to array

Implements Body.

void setVariables ( const double *  array  )  [virtual]

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