Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
closedplayground.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef __CLOSEDPLAYGROUND_H
25 #define __CLOSEDPLAYGROUND_H
26 
27 
28 #include "playground.h"
29 
30 namespace lpzrobots {
31 
32  class ClosedPlayground : public Playground {
33 
34  protected:
36 
37  public:
38 
40  const osg::Vec3& dimension = osg::Vec3(7.0, 0.2, 0.5) , double factorxy = 1)
41  : Playground(odeHandle, osgHandle, dimension, factorxy), roof(0){
42  };
43 
44 
45  protected:
46  virtual void create(){
48  roof = new Box(length + 2 * width , (length * factorlength2) + 2 * width , width);
49  roof->init(odeHandle, 0, osgHandle, Primitive::Geom | Primitive::Draw);
50 
52  obst.push_back(roof);
53  };
54 
55 
56  virtual void destroy(){
58  }
59  };
60 
61 }
62 
63 #endif
Data structure for accessing the ODE.
Definition: odehandle.h:44
OsgHandle osgHandle
Definition: abstractobstacle.h:174
Definition: closedplayground.h:32
virtual void setPosition(const Pos &pos)
set the position of the primitive (orientation is preserved)
Definition: primitive.cpp:147
virtual void destroy()
is called to destroy the object. The default implementation is to delete all primitives in "obst"...
Definition: closedplayground.h:56
double height
Definition: playground.h:37
OdeHandle odeHandle
Definition: abstractobstacle.h:173
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
Definition: primitive.h:89
virtual void create()
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Definition: playground.h:66
ClosedPlayground(const OdeHandle &odeHandle, const OsgHandle &osgHandle, const osg::Vec3 &dimension=osg::Vec3(7.0, 0.2, 0.5), double factorxy=1)
Definition: closedplayground.h:39
Vec3f Vec3
Definition: osgforwarddecl.h:42
Definition: primitive.h:89
virtual void create()
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Definition: closedplayground.h:46
double length
Definition: playground.h:37
double width
Definition: playground.h:37
Definition: playground.h:33
std::vector< Primitive * > obst
primitives which belong to this obstacle
Definition: abstractobstacle.h:166
Box primitive.
Definition: primitive.h:267
double factorlength2
Definition: playground.h:38
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
Box * roof
Definition: closedplayground.h:35
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:417