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

Generated on Mon Aug 7 16:40:14 2006 for Robotsystem of the Robot Group Leipzig by  doxygen 1.4.7