base.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 * * 00024 * base.h provides osg stuff for basic environment with sky and so on. * 00025 * * 00026 * $Log: base.h,v $ 00027 * Revision 1.3 2006/09/20 15:30:47 martius 00028 * shadowsize, light 00029 * 00030 * Revision 1.2 2006/07/14 12:23:33 martius 00031 * selforg becomes HEAD 00032 * 00033 * Revision 1.1.2.7 2006/06/29 16:35:56 robot3 00034 * includes cleared up 00035 * 00036 * Revision 1.1.2.6 2006/05/28 22:14:56 martius 00037 * heightfield included 00038 * 00039 * Revision 1.1.2.5 2006/05/18 11:45:51 robot3 00040 * -shadowing the normal scene integrated (first version) 00041 * -note that there is a bug that the shadow disappears 00042 * after some time (e.g. 60 minutes) 00043 * 00044 * Revision 1.1.2.4 2006/01/31 15:45:02 martius 00045 * virtual destructor 00046 * 00047 * Revision 1.1.2.3 2006/01/12 14:21:00 martius 00048 * drawmode, material 00049 * 00050 * Revision 1.1.2.2 2005/12/09 16:54:16 martius 00051 * camera is woring now 00052 * 00053 * Revision 1.1.2.1 2005/12/06 17:40:59 martius 00054 * base class for simulation 00055 * 00056 * * 00057 ***************************************************************************/ 00058 #ifndef __BASE_H 00059 #define __BASE_H 00060 00061 #include<ode/ode.h> 00062 #include<osg/Transform> 00063 00064 #include "osghandle.h" 00065 #include "odehandle.h" 00066 00067 class osg::Node; 00068 00069 namespace lpzrobots { 00070 00071 class MoveEarthySkyWithEyePointTransform : public osg::Transform { 00072 public: 00073 /** Get the transformation matrix which moves from local coords to world coords.*/ 00074 virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const; 00075 00076 /** Get the transformation matrix which moves from world coords to local coords.*/ 00077 virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const; 00078 }; 00079 00080 class Base { 00081 public: 00082 virtual osg::Group* makeScene(); 00083 virtual osg::Node* makeSky(); 00084 virtual osg::Node* makeGround(); 00085 virtual osg::LightSource* makeLights(osg::StateSet* stateset); 00086 virtual osg::Group* createShadowedScene(osg::Node* shadowed, 00087 osg::Vec3 posOfLight, 00088 unsigned int unit); 00089 00090 00091 virtual ~Base() {} 00092 00093 protected: 00094 dGeomID ground; 00095 00096 osg::Group* root; 00097 00098 OsgHandle osgHandle; 00099 // ODE globals 00100 OdeHandle odeHandle; 00101 00102 bool useShadow; 00103 unsigned int shadowTexSize; 00104 }; 00105 } 00106 00107 #endif

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