meshground.h

Go to the documentation of this file.
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 * frankguettler@gmx.de * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the * 00020 * Free Software Foundation, Inc., * 00021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00022 * * 00023 * $Log: meshground.h,v $ 00024 * Revision 1.2 2006/07/14 12:23:33 martius 00025 * selforg becomes HEAD 00026 * 00027 * Revision 1.1.2.2 2006/05/29 20:10:28 martius 00028 * docu, but moved to terrainground anyway 00029 * 00030 * Revision 1.1.2.1 2006/05/28 22:14:56 martius 00031 * heightfield included 00032 * 00033 * 00034 * * 00035 ***************************************************************************/ 00036 #ifndef __MESHGROUND_H 00037 #define __MESHGROUND_H 00038 00039 #include <stdio.h> 00040 #include <math.h> 00041 00042 #include "heightfieldprimitive.h" 00043 #include "abstractobstacle.h" 00044 00045 namespace lpzrobots { 00046 00047 class MeshGround : public AbstractObstacle { 00048 public: 00049 00050 00051 /** Constructor 00052 @param odeHandle 00053 @param osgHandle 00054 @param filename name of the file to load. 00055 If ending is .ppm then it is considered as a bitmap height file. 00056 The coding mode is used to decode the heights. 00057 Otherwise it is consider to be a OSG HeightFieldFile 00058 @param texture image filename for the texture 00059 @param x_size size in x direction in world coordinates 00060 @param y_size size in y direction in world coordinates 00061 @param height height in world coordinates 00062 @param coding Coding mode, see OSGHeightField (this an own class, not in OSG) 00063 */ 00064 MeshGround(const OdeHandle& odeHandle, const OsgHandle& osgHandle, 00065 const std::string& filename, const std::string& texture, 00066 double x_size, double y_size, double height, 00067 OSGHeightField::CodingMode coding = OSGHeightField::Red); 00068 00069 /** 00070 * updates the position of the geoms ( not nessary for static objects) 00071 */ 00072 virtual void update(){ }; 00073 00074 virtual void setPose(const osg::Matrix& pose); 00075 00076 00077 protected: 00078 virtual void create(); 00079 virtual void destroy(); 00080 00081 protected: 00082 std::string filename; 00083 std::string texture; 00084 HeightField* heightfield; 00085 double x_size; 00086 double y_size; 00087 double height; 00088 OSGHeightField::CodingMode coding; 00089 }; 00090 } 00091 00092 #endif

Generated on Tue Jan 16 02:14:36 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8