cameramanipulatorFollow.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  *  Camera Manipulation by mouse and keyboard                              *
00025  *                                                                         *
00026  *   $Log: cameramanipulatorFollow.h,v $
00027  *   Revision 1.1.2.3  2006/03/19 10:52:55  robot3
00028  *   follow mode now centers the view on the robot
00029  *   if the robot is choosed (only once)
00030  *
00031  *   Revision 1.1.2.2  2006/03/08 13:18:34  robot3
00032  *   follow mode now works, basic modifications
00033  *
00034  *   Revision 1.1.2.1  2006/03/06 16:59:18  robot3
00035  *   first dummy follow-version
00036  *
00037  *
00038  *                                                                         *
00039  ***************************************************************************/
00040 #ifndef __CAMERAMANIPULATORFOLLOW_H
00041 #define __CAMERAMANIPULATORFOLLOW_H
00042 
00043 #include "osgforwarddecl.h"
00044 #include "cameramanipulator.h"
00045 
00046 namespace lpzrobots {
00047 
00048   /**
00049      CameraManipulatorFollow is a MatrixManipulator which provides Flying simulator-like
00050      updating of the camera position & orientation. 
00051      Left mouse button: Pan and tilt
00052      Right mouse button: forward and sideways
00053      Middle mouse button: up and sideways
00054   */
00055 
00056   class CameraManipulatorFollow : public CameraManipulator {
00057 
00058     /** returns the classname of the manipulator
00059         it's NECCESSARY to define this funtion, otherwise
00060         the new manipulator WON'T WORK! (but ask me not why)
00061      */
00062     virtual const char* className() const { return "Following Camera"; }
00063 
00064   public:
00065     
00066     CameraManipulatorFollow(osg::Node* node,GlobalData& global);
00067       
00068   protected:
00069 
00070     virtual ~CameraManipulatorFollow();
00071 
00072     /** This handles robot movements, so that the camera movemenent is right affected.
00073         should be overwritten by new cameramanipulator
00074     */
00075     virtual void calcMovementByAgent();
00076 
00077 
00078     /** Sets the right view and eye if the robot has changed.
00079         Is called from manageRobots();
00080         should be overwritten by new cameramanipulator if needed
00081     */
00082         virtual void setHomeViewByAgent();
00083 
00084     
00085    
00086   };
00087 }
00088 
00089 #endif

Generated on Tue Apr 4 19:05:03 2006 for Robotsystem from Robot Group Leipzig by  doxygen 1.4.5