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
TerrainGround Class Reference

Class provides an terrain based on HeightFields. More...

#include <terrainground.h>

Inheritance diagram for TerrainGround:
Collaboration diagram for TerrainGround:

Public Member Functions

 TerrainGround (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const std::string &filename, const std::string &texture, double x_size, double y_size, double height, OSGHeightField::CodingMode coding=OSGHeightField::Red)
 Constructor. More...
 
virtual ~TerrainGround ()
 
virtual void update ()
 updates the position of the geoms ( not nessary for static objects) More...
 
virtual void setPose (const osg::Matrix &pose)
 sets position of the obstacle and creates/recreates obstacle if necessary More...
 
virtual PrimitivegetMainPrimitive () const
 return the "main" primitive of the obtactle. The meaning of "main" is arbitrary More...
 
- Public Member Functions inherited from AbstractObstacle
 AbstractObstacle (const OdeHandle &odeHandle, const OsgHandle &osgHandle)
 Constructor. More...
 
virtual ~AbstractObstacle ()
 
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 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 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 create ()
 overload this function to create the obstactle. All primitives should go into the list "obst" More...
 
virtual void destroy ()
 is called to destroy the object. The default implementation is to delete all primitives in "obst". More...
 

Protected Attributes

std::string filename
 
std::string texture
 
HeightFieldheightfield
 
double x_size
 
double y_size
 
double height
 
OSGHeightField::CodingMode coding
 
- Protected Attributes inherited from AbstractObstacle
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

Class provides an terrain based on HeightFields.

Can be loaded from image or from HeightFieldFiles

Constructor & Destructor Documentation

TerrainGround ( const OdeHandle odeHandle,
const OsgHandle osgHandle,
const std::string &  filename,
const std::string &  texture,
double  x_size,
double  y_size,
double  height,
OSGHeightField::CodingMode  coding = OSGHeightField::Red 
)

Constructor.

Parameters
odeHandle
osgHandle
filenamename of the file to load. If ending is .ppm then it is considered as a bitmap height file. The coding mode is used to decode the heights. Otherwise it is consider to be a OSG HeightFieldFile
textureimage filename for the texture
x_sizesize in x direction in world coordinates
y_sizesize in y direction in world coordinates
heightheight in world coordinates
codingCoding mode, see OSGHeightField (this is an own class, not in OSG)
virtual ~TerrainGround ( )
inlinevirtual

Member Function Documentation

void create ( )
protectedvirtual

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

Implements AbstractObstacle.

void destroy ( )
protectedvirtual

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

Reimplemented from AbstractObstacle.

virtual Primitive* getMainPrimitive ( ) const
inlinevirtual

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

Implements AbstractObstacle.

void setPose ( const osg::Matrix pose)
virtual

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

Implements AbstractObstacle.

virtual void update ( )
inlinevirtual

updates the position of the geoms ( not nessary for static objects)

Reimplemented from AbstractObstacle.

Member Data Documentation

OSGHeightField::CodingMode coding
protected
std::string filename
protected
double height
protected
HeightField* heightfield
protected
std::string texture
protected
double x_size
protected
double y_size
protected

The documentation for this class was generated from the following files: