Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AbstractObstacle Class Referenceabstract

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

#include <abstractobstacle.h>

Inheritance diagram for AbstractObstacle:
Collaboration diagram for AbstractObstacle:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::vector< Primitive * > obst
 primitives which belong to this obstacle More...
 
std::vector< std::vector
< TextureDescr > > 
textures
 for each primitive the texture settings per surface More...
 
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
odeHandlecontaining ODE stuff like world, space and jointgroup
osgHandlecontaining OSG stuff like scene, color... be used for creation of obstacles
~AbstractObstacle ( )
virtual

Member Function Documentation

virtual void create ( )
protectedpure virtual

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

Implemented in ComplexPlayground, PassiveMesh, RandomObstacles, Boxpile, PassiveCapsule, MeshObstacle, PassiveBox, PassiveSphere, Seesaw, TerrainGround, MeshGround, Playground, OctaPlayground, DummyObstacle, ClosedPlayground, and DummyGround.

void destroy ( )
protectedvirtual

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

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

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 PassiveMesh, RandomObstacles, PassiveCapsule, Boxpile, PassiveBox, PassiveSphere, TerrainGround, Seesaw, AbstractGround, and DummyObstacle.

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

void setColor ( const Color color)
virtual

sets the obstacle color

Parameters
colorvalues in RGBA
virtual void setColor ( const std::string &  color)
virtual
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 RandomObstacles, PassiveMesh, PassiveCapsule, Boxpile, MeshObstacle, TerrainGround, MeshGround, PassiveBox, PassiveSphere, Seesaw, AbstractGround, and DummyObstacle.

void setPosition ( const osg::Vec3 pos)
virtual

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

void setSubstance ( const Substance substance)
virtual

sets the substance of the obtactle.

It is applied to all objects in obj

Parameters
substancedescription of the substance
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 setTexture ( const TextureDescr texture)
virtual

assigns a texture to the all primitives of this obstactle

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 ( 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 update ( )
virtual

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

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

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: