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 * * 00023 * base.h provides osg stuff for basic environment with sky and so on. * 00024 * * 00025 * $Log: base.h,v $ 00026 * Revision 1.1.2.4 2006/01/31 15:45:02 martius 00027 * virtual destructor 00028 * 00029 * Revision 1.1.2.3 2006/01/12 14:21:00 martius 00030 * drawmode, material 00031 * 00032 * Revision 1.1.2.2 2005/12/09 16:54:16 martius 00033 * camera is woring now 00034 * 00035 * Revision 1.1.2.1 2005/12/06 17:40:59 martius 00036 * base class for simulation 00037 * 00038 * * 00039 ***************************************************************************/ 00040 #ifndef __BASE_H 00041 #define __BASE_H 00042 00043 #include<ode/ode.h> 00044 #include<osg/Transform> 00045 00046 #include "osghandle.h" 00047 #include "odehandle.h" 00048 00049 class osg::Node; 00050 class osg::Node; 00051 00052 00053 namespace lpzrobots { 00054 00055 class MoveEarthySkyWithEyePointTransform : public osg::Transform { 00056 public: 00057 /** Get the transformation matrix which moves from local coords to world coords.*/ 00058 virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const; 00059 00060 /** Get the transformation matrix which moves from world coords to local coords.*/ 00061 virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const; 00062 }; 00063 00064 class Base { 00065 public: 00066 virtual osg::Group* makeScene(); 00067 virtual osg::Node* makeSky(); 00068 virtual osg::Node* makeGround(); 00069 virtual osg::LightSource* makeLights(osg::StateSet* stateset); 00070 00071 virtual ~Base() {} 00072 00073 protected: 00074 dGeomID ground; 00075 00076 osg::Group* root; 00077 00078 OsgHandle osgHandle; 00079 // ODE globals 00080 OdeHandle odeHandle; 00081 }; 00082 } 00083 00084 #endif