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 * * 00024 * This file provides the main simulation loop using open scene graph * 00025 * It creates the world scene and call the call back functions and so on.* 00026 * * 00027 * * 00028 * $Log: osgmainloop.h,v $ 00029 * Revision 1.1.2.1 2005/12/06 10:13:24 martius 00030 * openscenegraph integration started 00031 * 00032 * * 00033 * * 00034 ***************************************************************************/ 00035 #ifndef __OSGMAINLOOP_H 00036 #define __OSGMAINLOOP_H 00037 00038 #include <ode/ode.h> 00039 00040 #include "odehandle.h" 00041 #include "globaldata.h" 00042 00043 class OSGMainLoop { 00044 public: 00045 OSGMainLoop(){ 00046 00047 } 00048 00049 protected: 00050 /// user defined start function (called at the beginning of the simulation) 00051 void (*startFunction)(const OdeHandle&, GlobalData& globalData); 00052 /// user defined end function (called after the simulation) 00053 void (*endFunction)(GlobalData& globalData); 00054 /// pointer to the config function of the user 00055 void (*configFunction)(GlobalData& globalData); 00056 // command function, set by user 00057 void (*commandFunction)(const OdeHandle&, GlobalData& globalData, int key); 00058 /// pointer to the user defined additional function 00059 void (*collisionCallback)(const OdeHandle&, void* data, dGeomID o1, dGeomID o2); 00060 /// pointer to the user defined additional function which is executed in each simulationstep 00061 void (*additionalCallback)(GlobalData& globalData, bool draw, bool pause); 00062 } 00063 00064 00065 #endif