AbstractObstacle Class Reference

Abstract class (interface) for obstacles. More...

#include <abstractobstacle.h>

Inherited by AbstractGround, MeshGround, MeshObstacle, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, and TerrainGround.

Inheritance diagram for AbstractObstacle:

Inheritance graph
[legend]
Collaboration diagram for AbstractObstacle:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AbstractObstacle (const OdeHandle &odeHandle, const OsgHandle &osgHandle)
 Constructor.
virtual ~AbstractObstacle ()
virtual void update ()
 updates the position if the scenegraph nodes the default implementation calls update on all primitive on "obst"
virtual void setPos (const osg::Vec3 &pos)
 sets position of the obstacle and creates/recreates obstacle if necessary
virtual void setPosition (const osg::Vec3 &pos)
 sets position of the obstacle and creates/recreates obstacle if necessary
virtual osg::Vec3 getPos ()
 gives actual position of the obstacle
virtual osg::Matrix getPose ()
 gives actual pose of the obstacle
virtual void setPose (const osg::Matrix &pose)=0
 sets position of the obstacle and creates/recreates obstacle if necessary
virtual void setColor (const Color &color)
 sets the obstacle color
virtual void setTexture (const std::string &filename, double repeatOnX=1, double repeatOnY=1)
 assigns a texture to the all primitives of this obstactle
virtual void setTexture (int surface, const std::string &filename, double repeatOnX, double repeatOnY)
 assigns a texture to the x-th surface of each primitive,
virtual PrimitivegetMainPrimitive () const =0
 return the "main" primitive of the obtactle. The meaning of "main" is arbitrary
virtual void setSubstance (const Substance &substance)
 sets the substance of the obtactle.
virtual Position getPosition () const
 returns position of the object
virtual Position getSpeed () const
 returns linear speed vector of the object
virtual Position getAngularSpeed () const
 returns angular velocity vector of the object
virtual matrix::Matrix getOrientation () const
 returns the orientation of the object

Protected Member Functions

virtual void destroy ()
 is called to destroy the object. The default implementation is to delete all primitives in "obst".
virtual void create ()=0
 overload this function to create the obstactle. All primitives should go into the list "obst"

Protected Attributes

std::vector< Primitive * > obst
 primitives which belong to this obstacle
osg::Matrix pose
bool obstacle_exists
OdeHandle odeHandle
OsgHandle osgHandle

Detailed Description

Abstract class (interface) for obstacles.


Constructor & Destructor Documentation

AbstractObstacle ( const OdeHandle odeHandle,
const OsgHandle osgHandle 
)

Constructor.

Parameters:
odeHandle containing ODE stuff like world, space and jointgroup
osgHandle containing OSG stuff like scene, color... be used for creation of obstacles

~AbstractObstacle (  )  [virtual]


Member Function Documentation

virtual void create (  )  [protected, pure virtual]

overload this function to create the obstactle. All primitives should go into the list "obst"

Implemented in ClosedPlayground, ComplexPlayground, MeshGround, MeshObstacle, OctaPlayground, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, Playground, and TerrainGround.

void destroy (  )  [protected, virtual]

is called to destroy the object. The default implementation is to delete all primitives in "obst".

Reimplemented in ClosedPlayground, MeshGround, MeshObstacle, PassiveCapsule, PassiveMesh, and TerrainGround.

Position getAngularSpeed (  )  const [virtual]

returns angular velocity vector of the object

Returns:
vector (wx,wy,wz)

virtual Primitive* getMainPrimitive (  )  const [pure virtual]

return the "main" primitive of the obtactle. The meaning of "main" is arbitrary

Implemented in AbstractGround, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, and TerrainGround.

matrix::Matrix getOrientation (  )  const [virtual]

returns the orientation of the object

Returns:
3x3 rotation matrix

osg::Vec3 getPos (  )  [virtual]

gives actual position of the obstacle

osg::Matrix getPose (  )  [virtual]

gives actual pose of the obstacle

Position getPosition (  )  const [virtual]

returns position of the object

Returns:
vector of position (x,y,z)

Position getSpeed (  )  const [virtual]

returns linear speed vector of the object

Returns:
vector (vx,vy,vz)

void setColor ( const Color color  )  [virtual]

sets the obstacle color

Parameters:
color values in RGBA

void setPos ( const osg::Vec3 pos  )  [virtual]

sets position of the obstacle and creates/recreates obstacle if necessary

virtual void setPose ( const osg::Matrix pose  )  [pure virtual]

sets position of the obstacle and creates/recreates obstacle if necessary

Implemented in AbstractGround, MeshGround, MeshObstacle, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, and TerrainGround.

void setPosition ( const osg::Vec3 pos  )  [virtual]

sets position of the obstacle and creates/recreates obstacle if necessary

Examples:
template_sphererobot/main.cpp.

void setSubstance ( const Substance substance  )  [virtual]

sets the substance of the obtactle.

It is applied to all objects in obj

Parameters:
substance description of the substance

void setTexture ( int  surface,
const std::string &  filename,
double  repeatOnX,
double  repeatOnY 
) [virtual]

assigns a texture to the x-th surface of each primitive,

See also:
Primitive::setTexture()

void setTexture ( const std::string &  filename,
double  repeatOnX = 1,
double  repeatOnY = 1 
) [virtual]

assigns a texture to the all primitives of this obstactle

See also:
Primitive::setTexture()

Reimplemented in AbstractGround.

void update (  )  [virtual]

updates the position if the scenegraph nodes the default implementation calls update on all primitive on "obst"

Reimplemented in MeshGround, MeshObstacle, PassiveCapsule, PassiveMesh, and TerrainGround.


Member Data Documentation

std::vector<Primitive*> obst [protected]

primitives which belong to this obstacle

bool obstacle_exists [protected]

OdeHandle odeHandle [protected]

OsgHandle osgHandle [protected]

osg::Matrix pose [protected]


The documentation for this class was generated from the following files:
Generated on Fri Oct 30 16:29:03 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7