24 #ifndef __PASSIVEMESH_H
25 #define __PASSIVEMESH_H
53 const std::string& filename,
54 double scale = 1.0,
double mass = 1.0):
56 filename(filename), scale(scale), mass(mass){
90 mesh =
new Mesh(filename,scale);
100 if(mesh)
delete mesh;
virtual void setPose(const Pose &pose)
set the pose of the primitive
Definition: primitive.cpp:799
Data structure for accessing the ODE.
Definition: odehandle.h:44
OsgHandle osgHandle
Definition: abstractobstacle.h:174
Abstract class (interface) for obstacles.
Definition: abstractobstacle.h:46
Matrixd Matrix
Definition: osgforwarddecl.h:47
bool obstacle_exists
Definition: abstractobstacle.h:171
OdeHandle odeHandle
Definition: abstractobstacle.h:173
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
virtual Primitive * getMainPrimitive() const
return the "main" primitive of the obtactle. The meaning of "main" is arbitrary
Definition: passivemesh.h:85
virtual void create()
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Definition: passivemesh.h:89
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
Mesh primitive.
Definition: primitive.h:374
virtual void update()
update position of mesh
Definition: passivemesh.h:68
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:748
osg::Matrix pose
Definition: abstractobstacle.h:170
PassiveMesh(const OdeHandle &odeHandle, const OsgHandle &osgHandle, const std::string &filename, double scale=1.0, double mass=1.0)
Constructor.
Definition: passivemesh.h:51
virtual void update()
Updates the OSG nodes with ODE coordinates.
Definition: primitive.cpp:826
virtual void setPose(const osg::Matrix &pose)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: passivemesh.h:76
~PassiveMesh()
Definition: passivemesh.h:61
virtual void destroy()
is called to destroy the object. The default implementation is to delete all primitives in "obst"...
Definition: passivemesh.h:99
(Passive) mesh as obstacle
Definition: passivemesh.h:39