24 #ifndef __MESHOBSTACLE_H
25 #define __MESHOBSTACLE_H
29 #include <osg/BoundingSphere>
86 const osg::BoundingSphere& bsphere =
mesh->
getGroup()->getBound();
91 printf(
"use default bounding box, because bbox file not found\n");
95 osg::Matrix::translate(0.0f,0.0f,bsphere.radius()));
virtual void update()
updates the position of the geoms ( not nessary for static objects)
Definition: meshobstacle.h:63
OSGMesh * mesh
Definition: meshobstacle.h:43
Data structure for accessing the ODE.
Definition: odehandle.h:44
virtual void destroy()
is called to destroy the object. The default implementation is to delete all primitives in "obst"...
Definition: meshobstacle.h:102
OsgHandle osgHandle
Definition: abstractobstacle.h:174
OsgHandle changeColor(const Color &color) const
returns a new osghandle with only the color changed
Definition: osghandle.cpp:105
Abstract class (interface) for obstacles.
Definition: abstractobstacle.h:46
Graphical Mesh or arbitrary OSG model.
Definition: osgprimitive.h:253
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:579
bool obstacle_exists
Definition: abstractobstacle.h:171
Sphere primitive.
Definition: primitive.h:289
OdeHandle odeHandle
Definition: abstractobstacle.h:173
virtual void init(const OdeHandle &odeHandle, double mass, const OsgHandle &osgHandle, char mode=Body|Geom|Draw)
registers primitive in ODE and OSG.
Definition: primitive.cpp:470
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
Definition: primitive.h:89
BoundingShape * boundshape
Definition: meshobstacle.h:45
Definition: meshobstacle.h:37
class for reading bounding shape description files (.bbox) and to create appropriate geoms ...
Definition: boundingshape.h:63
Definition: primitive.h:89
virtual void create()
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Definition: meshobstacle.h:81
MeshObstacle(const OdeHandle &odeHandle, const OsgHandle &osgHandle, std::string filename, double scale=1)
Definition: meshobstacle.h:49
virtual void setMatrix(const osg::Matrix &m4x4)
Sets the transformation matrix of this object (position and orientation)
Definition: osgprimitive.cpp:83
std::string filename
Definition: meshobstacle.h:41
osg::Matrix pose
Definition: abstractobstacle.h:170
Sphere * bound
Definition: meshobstacle.h:44
virtual void setPose(const Pose &pose)
set the pose of the primitive
Definition: primitive.cpp:156
float scale
Definition: meshobstacle.h:42
virtual osg::Group * getGroup()
returns the group object which is the root of all subcomponents of this primitive ...
Definition: osgprimitive.cpp:88
virtual void setPose(const osg::Matrix &pose)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: meshobstacle.h:70
virtual bool init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, double scale, char mode)
tries to open the bbox file and greates all geoms
Definition: boundingshape.cpp:123