glc_flymover.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00100 private:
00102 GLC_Vector3d mapForFlying(double x, double y);
00103
00105 void fly();
00106
00108
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