#include <abstractobstacle.h>
Inherited by AbstractGround, MeshGround, MeshObstacle, PassiveBox, PassiveCapsule, PassiveMesh, PassiveSphere, and TerrainGround.
Inheritance diagram for AbstractObstacle:
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 Primitive * | getMainPrimitive () 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 |
AbstractObstacle | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle | |||
) |
Constructor.
odeHandle | containing ODE stuff like world, space and jointgroup | |
osgHandle | containing OSG stuff like scene, color... be used for creation of obstacles |
~AbstractObstacle | ( | ) | [virtual] |
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
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
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
Position getSpeed | ( | ) | const [virtual] |
returns linear speed vector of the object
void setColor | ( | const Color & | color | ) | [virtual] |
sets the obstacle color
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
void setSubstance | ( | const Substance & | substance | ) | [virtual] |
sets the substance of the obtactle.
It is applied to all objects in obj
substance | description of the substance |
void setTexture | ( | int | surface, | |
const std::string & | filename, | |||
double | repeatOnX, | |||
double | repeatOnY | |||
) | [virtual] |
void setTexture | ( | const std::string & | filename, | |
double | repeatOnX = 1 , |
|||
double | repeatOnY = 1 | |||
) | [virtual] |
assigns a texture to the all primitives of this obstactle
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.
bool obstacle_exists [protected] |
osg::Matrix pose [protected] |