24 #ifndef __PASSIVECAPSULE_H
25 #define __PASSIVECAPSULE_H
52 float radius=1.0,
float height=1.0,
double mass = 1.0):
54 capsule =
new Capsule(radius,height);
55 obst.push_back(capsule);
66 if(capsule) capsule->
update();
74 this->pose = osg::Matrix::translate(0,0,height*0.5f+radius) *
pose;
virtual void setTexture(const std::string &filename)
assigns a texture to the all primitives of this obstactle with repeat -1,-1
Definition: passivecapsule.h:69
Capsule primitive.
Definition: primitive.h:308
Data structure for accessing the ODE.
Definition: odehandle.h:44
OsgHandle osgHandle
Definition: abstractobstacle.h:174
virtual std::vector< TextureDescr > getTextures(int primitive) const
returns the textures of the given primitive
Definition: abstractobstacle.cpp:147
virtual void update()
Updates the OSG nodes with ODE coordinates.
Definition: primitive.cpp:542
Abstract class (interface) for obstacles.
Definition: abstractobstacle.h:46
virtual Primitive * getMainPrimitive() const
return the "main" primitive of the obtactle. The meaning of "main" is arbitrary
Definition: passivecapsule.h:81
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual void create()
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Definition: passivecapsule.h:84
bool obstacle_exists
Definition: abstractobstacle.h:171
OdeHandle odeHandle
Definition: abstractobstacle.h:173
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
PassiveCapsule(const OdeHandle &odeHandle, const OsgHandle &osgHandle, float radius=1.0, float height=1.0, double mass=1.0)
Constructor.
Definition: passivecapsule.h:51
Definition: primitive.h:89
virtual void update()
update position of box
Definition: passivecapsule.h:65
~PassiveCapsule()
Definition: passivecapsule.h:59
Definition: primitive.h:89
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
virtual void setTextures(const std::vector< TextureDescr > &textures)
assign a set of texture to the surfaces of the primitive
Definition: primitive.cpp:142
osg::Matrix pose
Definition: abstractobstacle.h:170
virtual void setPose(const osg::Matrix &pose)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: passivecapsule.h:73
virtual void setTexture(const std::string &filename)
assigns a texture to the primitive
Definition: osgprimitive.cpp:101
virtual void setPose(const Pose &pose)
set the pose of the primitive
Definition: primitive.cpp:156
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:521
(Passive) capsule as obstacle
Definition: passivecapsule.h:38
virtual OSGPrimitive * getOSGPrimitive()
returns the assoziated osg primitive if there or 0
Definition: primitive.cpp:519