AbstractObstacle Class Reference

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

#include <abstractobstacle.h>

Inherited by AbstractGround, Boxpile, DummyObstacle, MeshGround, MeshObstacle, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, RandomObstacles, Seesaw, and TerrainGround.

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 setColor (const std::string &color)
virtual void setTexture (const std::string &texturefilename)
 assigns a texture to the all primitives of this obstactle with repeat -1,-1
virtual void setTexture (const TextureDescr &texture)
 assigns a texture to the all primitives of this obstactle
virtual void setTexture (int surface, const TextureDescr &texture)
 assigns a texture to the x-th surface of each primitive,
virtual void setTexture (int primitive, int surface, const TextureDescr &texture)
 assigns a texture to the x-th surface of the k-th primitive, (The texture setting of the last primitve is repeated for the remaining ones)
virtual TextureDescr getTexture (int primitive, int surface) const
 returns the texture of the given surface on the given primitive
virtual std::vector< TextureDescrgetTextures (int primitive) const
 returns the textures of the given 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 const SubstancegetSubstance ()
 returns the substance of this obstacle
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
std::vector< std::vector
< TextureDescr > > 
textures
 for each primitive the texture settings per surface
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 Boxpile, ClosedPlayground, ComplexPlayground, DummyGround, DummyObstacle, MeshGround, MeshObstacle, OctaPlayground, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, Playground, RandomObstacles, Seesaw, 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, 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, Boxpile, DummyObstacle, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, RandomObstacles, Seesaw, 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)
const Substance & getSubstance (  )  [virtual]

returns the substance of this obstacle

TextureDescr getTexture ( int  primitive,
int  surface 
) const [virtual]

returns the texture of the given surface on the given primitive

std::vector< TextureDescr > getTextures ( int  primitive  )  const [virtual]

returns the textures of the given primitive

virtual void setColor ( const std::string &  color  )  [virtual]
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, Boxpile, DummyObstacle, MeshGround, MeshObstacle, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, RandomObstacles, Seesaw, 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  primitive,
int  surface,
const TextureDescr texture 
) [virtual]

assigns a texture to the x-th surface of the k-th primitive, (The texture setting of the last primitve is repeated for the remaining ones)

See also:
Primitive::setTexture()
void setTexture ( int  surface,
const TextureDescr texture 
) [virtual]

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

See also:
Primitive::setTexture()
void setTexture ( const TextureDescr texture  )  [virtual]

assigns a texture to the all primitives of this obstactle

See also:
Primitive::setTexture()
void setTexture ( const std::string &  texturefilename  )  [virtual]

assigns a texture to the all primitives of this obstactle with repeat -1,-1

See also:
Primitive::setTexture()

Reimplemented in PassiveCapsule, and PassiveSphere.

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]
std::vector<std::vector<TextureDescr> > textures [protected]

for each primitive the texture settings per surface


The documentation for this class was generated from the following files:
Generated on Thu Jun 28 14:48:40 2012 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3