GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_flymover.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
23 
24 #ifndef GLC_FLYMOVER_H_
25 #define GLC_FLYMOVER_H_
26 #include "glc_mover.h"
27 
28 #include "../glc_config.h"
29 
32 
33 
35 {
37 
39 
40 public:
42  GLC_FlyMover(GLC_Viewport*, const QList<GLC_RepMover*>& repsList= QList<GLC_RepMover*>());
43 
45  GLC_FlyMover(const GLC_FlyMover& flyMover);
46 
48  virtual ~GLC_FlyMover();
50 
52 
54 
55 public:
57  virtual GLC_Mover* clone() const;
58 
60  inline double turningRate() const
61  {return m_TurnRate / glc::PI * 180.0;}
62 
64  inline double flyingVelocity() const
65  {return m_Velocity;}
67 
69 
71 
72 public:
74  virtual void init(const GLC_UserInput& userInput);
75 
77  virtual bool move(const GLC_UserInput& userInput);
78 
80  virtual void ends();
81 
83  inline void setMaximumTurnRate(double turnRate)
84  {m_TurnRate= turnRate;}
85 
87  void setFlyingVelocity(double velocity);
88 
90  void increaseVelocity(double factor);
91 
93 
94 protected:
95  void timerEvent(QTimerEvent*);
96 
98 // Private services Functions
100 private:
102  GLC_Vector3d mapForFlying(double x, double y);
103 
105  void fly();
106 
108 // Private Members
110 private:
112  double m_TurnRate;
113 
116 
119 
121  double m_Velocity;
122 
123 };
124 
125 #endif /* GLC_FLYMOVER_H_ */

©2005-2013 Laurent Ribon