00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 * * 00022 * $Log: closedplayground.h,v $ 00023 * Revision 1.7 2008/05/06 17:14:17 martius 00024 * buildsystem further tuned, 00025 * help in Makefile 00026 * osg/data directory is also installed and registered at osg_robots 00027 * 00028 * Revision 1.6 2007/03/16 11:01:37 martius 00029 * abstractobstacle gets mor functionallity 00030 * setSubstance 00031 * 00032 * Revision 1.5 2006/09/12 08:23:13 robot8 00033 * -corrected the wrong call for pos with getPosition () 00034 * 00035 * Revision 1.4 2006/08/11 15:41:04 martius 00036 * playgrounds handle non-quadratic ground planes 00037 * 00038 * Revision 1.3 2006/07/14 12:23:32 martius 00039 * selforg becomes HEAD 00040 * 00041 * Revision 1.2.4.2 2006/05/11 08:59:15 robot3 00042 * -fixed a positioning bug (e.g. for passivesphere) 00043 * -some methods moved to abstractobstacle.h for avoiding inconsistencies 00044 * 00045 * Revision 1.2.4.1 2006/01/10 20:25:08 martius 00046 * moved to osg 00047 * 00048 * Revision 1.2 2005/09/22 12:24:36 martius 00049 * removed global variables 00050 * OdeHandle and GlobalData are used instead 00051 * sensor prepared 00052 * 00053 * Revision 1.1 2005/07/21 12:01:54 robot8 00054 * adding a new obstacle, which is similar to playground, but closed to all directions 00055 * 00056 * Revision 1.6 2005/07/18 14:52:33 martius 00057 * world and space are not pointers anymore. 00058 * 00059 * Revision 1.5 2005/07/07 10:24:23 martius 00060 * avoid internal collisions 00061 * 00062 * Revision 1.4 2005/06/15 14:22:11 martius 00063 * GPL included 00064 * * 00065 ***************************************************************************/ 00066 #ifndef __CLOSEDPLAYGROUND_H 00067 #define __CLOSEDPLAYGROUND_H 00068 00069 00070 #include "playground.h" 00071 00072 namespace lpzrobots { 00073 00074 class ClosedPlayground : public Playground { 00075 00076 protected: 00077 Box* roof; 00078 00079 public: 00080 00081 ClosedPlayground(const OdeHandle& odeHandle, const OsgHandle& osgHandle , 00082 const osg::Vec3& dimension = osg::Vec3(7.0, 0.2, 0.5) , double factorxy = 1) 00083 : Playground(odeHandle, osgHandle, dimension, factorxy){ 00084 }; 00085 00086 00087 protected: 00088 virtual void create(){ 00089 Playground::create(); 00090 roof = new Box(length + 2 * width , (length * factorlength2) + 2 * width , width); 00091 roof->init(odeHandle, 0, osgHandle, Primitive::Geom | Primitive::Draw); 00092 00093 roof->setPosition(getPos() + osg::Vec3(0,0,height+width/2)); 00094 obst.push_back(roof); 00095 }; 00096 00097 00098 virtual void destroy(){ 00099 Playground::destroy(); 00100 } 00101 }; 00102 00103 } 00104 00105 #endif