glc_flymover.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib 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 Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021  *****************************************************************************/
00023 
00024 #ifndef GLC_FLYMOVER_H_
00025 #define GLC_FLYMOVER_H_
00026 #include "glc_mover.h"
00027 
00028 #include "../glc_config.h"
00029 
00032 
00033 
00034 class GLC_LIB_EXPORT GLC_FlyMover : public GLC_Mover
00035 {
00037 
00039 
00040 public:
00042         GLC_FlyMover(GLC_Viewport*, const QList<GLC_RepMover*>& repsList= QList<GLC_RepMover*>());
00043 
00045         GLC_FlyMover(const GLC_FlyMover& flyMover);
00046 
00048         virtual ~GLC_FlyMover();
00050 
00052 
00054 
00055 public:
00057         virtual GLC_Mover* clone() const;
00058 
00060         inline double turningRate() const
00061         {return m_TurnRate / glc::PI * 180.0;}
00062 
00064         inline double flyingVelocity() const
00065         {return m_Velocity;}
00067 
00069 
00071 
00072 public:
00074         virtual void init(const GLC_UserInput& userInput);
00075 
00077         virtual bool move(const GLC_UserInput& userInput);
00078 
00080         virtual void ends();
00081 
00083         inline void setMaximumTurnRate(double turnRate)
00084         {m_TurnRate= turnRate;}
00085 
00087         void setFlyingVelocity(double velocity);
00088 
00090         void increaseVelocity(double factor);
00091 
00093 
00094 protected:
00095     void timerEvent(QTimerEvent*);
00096 
00098 // Private services Functions
00100 private:
00102         GLC_Vector3d mapForFlying(double x, double y);
00103 
00105         void fly();
00106 
00108 // Private Members
00110 private:
00112         double m_TurnRate;
00113 
00115         int m_TimerId;
00116 
00118         int m_TimerInterval;
00119 
00121         double m_Velocity;
00122 
00123 };
00124 
00125 #endif /* GLC_FLYMOVER_H_ */

SourceForge.net Logo

©2005-2011 Laurent Ribon