24 #ifndef __ABSTRACTOBSTACLE_H
25 #define __ABSTRACTOBSTACLE_H
27 #include <ode-dbl/ode.h>
36 namespace matrix {
class Matrix; }
101 virtual void setColor(
const std::string& color);
108 virtual void setTexture(
const std::string& texturefilename);
127 virtual std::vector<TextureDescr>
getTextures(
int primitive)
const;
virtual TextureDescr getTexture(int primitive, int surface) const
returns the texture of the given surface on the given primitive
Definition: abstractobstacle.cpp:137
Matrix type.
Definition: matrix.h:65
virtual void setColor(const Color &color)
sets the obstacle color
Definition: abstractobstacle.cpp:89
Data structure for accessing the ODE.
Definition: odehandle.h:44
OsgHandle osgHandle
Definition: abstractobstacle.h:174
virtual matrix::Matrix getOrientation() const
returns the orientation of the object
Definition: abstractobstacle.cpp:208
virtual std::vector< TextureDescr > getTextures(int primitive) const
returns the textures of the given primitive
Definition: abstractobstacle.cpp:147
virtual void setTexture(const std::string &texturefilename)
assigns a texture to the all primitives of this obstactle with repeat -1,-1
Definition: abstractobstacle.cpp:107
Physical substance definition, used for collision detection/treatment What we need is mu...
Definition: substance.h:103
Abstract class (interface) for obstacles.
Definition: abstractobstacle.h:46
virtual Primitive * getMainPrimitive() const =0
return the "main" primitive of the obtactle. The meaning of "main" is arbitrary
virtual Position getAngularSpeed() const
returns angular velocity vector of the object
Definition: abstractobstacle.cpp:201
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual const Substance & getSubstance()
returns the substance of this obstacle
Definition: abstractobstacle.cpp:166
std::vector< std::vector< TextureDescr > > textures
for each primitive the texture settings per surface
Definition: abstractobstacle.h:168
virtual Position getPosition() const
returns position of the object
Definition: abstractobstacle.cpp:182
virtual void update()
updates the position if the scenegraph nodes the default implementation calls update on all primitive...
Definition: abstractobstacle.cpp:54
bool obstacle_exists
Definition: abstractobstacle.h:171
virtual Position getSpeed() const
returns linear speed vector of the object
Definition: abstractobstacle.cpp:194
OdeHandle odeHandle
Definition: abstractobstacle.h:173
virtual void create()=0
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
Definition: position.h:30
Vec3f Vec3
Definition: osgforwarddecl.h:42
holds texture file and repeat information.
Definition: osgprimitive.h:42
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
std::vector< Primitive * > obst
primitives which belong to this obstacle
Definition: abstractobstacle.h:166
osg::Matrix pose
Definition: abstractobstacle.h:170
AbstractObstacle(const OdeHandle &odeHandle, const OsgHandle &osgHandle)
Constructor.
Definition: abstractobstacle.cpp:43
virtual osg::Matrix getPose()
gives actual pose of the obstacle
Definition: abstractobstacle.cpp:87
virtual void setSubstance(const Substance &substance)
sets the substance of the obtactle.
Definition: abstractobstacle.cpp:157
virtual osg::Vec3 getPos()
gives actual position of the obstacle
Definition: abstractobstacle.cpp:80
virtual void destroy()
is called to destroy the object. The default implementation is to delete all primitives in "obst"...
Definition: abstractobstacle.cpp:171
virtual void setPosition(const osg::Vec3 &pos)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: abstractobstacle.cpp:73
virtual void setPos(const osg::Vec3 &pos)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: abstractobstacle.cpp:65
virtual void setPose(const osg::Matrix &pose)=0
sets position of the obstacle and creates/recreates obstacle if necessary
virtual ~AbstractObstacle()
Definition: abstractobstacle.cpp:50