00001 /*************************************************************************** 00002 * Copyright (C) 2005-2011 LpzRobots development team * 00003 * Georg Martius <georg dot martius at web dot de> * 00004 * Frank Guettler <guettler at informatik dot uni-leipzig dot de * 00005 * Frank Hesse <frank at nld dot ds dot mpg dot de> * 00006 * Ralf Der <ralfder at mis dot mpg dot 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 #ifndef _CAMERAHANDLE_H_ 00025 #define _CAMERAHANDLE_H_ 00026 00027 00028 #include <selforg/position.h> 00029 #include <osg/Vec3f> 00030 00031 // forward declarations 00032 namespace lpzrobots 00033 { 00034 class OSGPrimitive; 00035 class OdeAgent; 00036 } 00037 00038 namespace osg 00039 { 00040 class Vec3f; 00041 typedef Vec3f Vec3; 00042 class Camera; 00043 } 00044 00045 namespace lpzrobots 00046 { 00047 00048 /** 00049 * Class which holds all data used by CameraManipulators. 00050 * The avoidance of static variables enables multithreaded (tasked) 00051 * simulations. 00052 */ 00053 class CameraHandle 00054 { 00055 public: 00056 enum ManipulationType { No, Translational, TranslationalHorizontal , Rotational}; 00057 00058 osg::Vec3 eye; 00059 osg::Vec3 view; 00060 osg::Vec3 home_eye; 00061 osg::Vec3 home_view; 00062 osg::Vec3 desiredEye; 00063 osg::Vec3 desiredView; 00064 bool home_externally_set; 00065 OdeAgent* watchingAgent; 00066 bool watchingAgentDefined; 00067 Position oldPositionOfAgent; 00068 bool oldPositionOfAgentDefined; 00069 00070 ManipulationType doManipulation; 00071 osg::Vec3 manipulationPoint; 00072 OSGPrimitive* manipulationViz; 00073 double manipulationForce; 00074 00075 osg::Camera* cam; 00076 00077 CameraHandle(); 00078 00079 virtual ~CameraHandle(); 00080 }; 00081 00082 } 00083 00084 #endif /* _CAMERAHANDLE_H_ */