Polygon Class Reference
[Physical bodies]

Rigid polygon. More...

#include <rigidbody.h>

Inheritance diagram for Polygon:

RigidBody Item Body Object List of all members.

Public Member Functions

const std::vector< Vector2d > & vertexes () const
std::vector< Vector2d > & vertexes ()
void setVertexes (const std::vector< Vector2d > &vertexes)
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 polygon.


Member Function Documentation

const std::vector<Vector2d>& vertexes (  )  const [inline]

Get vertex list (constant)

std::vector<Vector2d>& vertexes (  )  [inline]

Get vertex list (editable)

void setVertexes ( const std::vector< Vector2d > &  vertexes  )  [inline]

Set vertex list

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

Get position of the center of mass of the body

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

Set position of the center of mass of the body

double angle (  )  const [inline, inherited]

Get angle of the body

void setAngle ( double  angle  )  [inline, inherited]

Set angle of the body

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

Get velocity of the center of mass of the body

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

Set velocity of the particle

double angularVelocity (  )  const [inline, inherited]

Get angular velocity of the body

void setAngularVelocity ( double  angularVelocity  )  [inline, inherited]

Set angular velocity of the body

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

Get force that acts upon the body

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

Set force that acts upon the body

double torque (  )  const [inline, inherited]

Get torque that acts upon the body

void setTorque ( double  torque  )  [inline, inherited]

Set torque that acts upon the body

void applyForce ( Vector2d  force,
Vector2d  position 
) [inherited]

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

void applyTorque ( double  torque  )  [inherited]

Apply torque to the body

double mass (  )  const [inline, inherited]

Get mass of the body

void setMass ( double  mass  )  [inline, inherited]

Set mass of the body

double inertia (  )  const [inline, inherited]

Get inertia "tensor" of the body

void setInertia ( double  inertia  )  [inline, inherited]

Set inertia "tensor" of the body

Vector2d pointLocalToWorld ( const Vector2d p  )  [inherited]

Translate local coordinates on body to world coordinates

Vector2d pointWorldToLocal ( const Vector2d p  )  [inherited]

Translate world coordinates to local coordinates on body

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