1 | |
---|
2 | /*! |
---|
3 | * @file helicopter.h |
---|
4 | * Implements the Control of a Helicopter |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _HELICOPTER_H |
---|
8 | #define _HELICOPTER_H |
---|
9 | |
---|
10 | #include "playable.h" |
---|
11 | |
---|
12 | |
---|
13 | class Helicopter : public Playable |
---|
14 | { |
---|
15 | |
---|
16 | public: |
---|
17 | |
---|
18 | Helicopter(); |
---|
19 | Helicopter(const std::string& fileName); |
---|
20 | Helicopter(const TiXmlElement* root); |
---|
21 | virtual ~Helicopter(); |
---|
22 | |
---|
23 | virtual void loadParams(const TiXmlElement* root); |
---|
24 | virtual void setAbsDirPlay(const Quaternion& rot){/* FIXME */}; |
---|
25 | |
---|
26 | virtual void enter(); |
---|
27 | virtual void leave(); |
---|
28 | |
---|
29 | virtual void postSpawn(); |
---|
30 | virtual void leftWorld(); |
---|
31 | |
---|
32 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
33 | virtual void tick(float time); |
---|
34 | virtual void draw() const; |
---|
35 | |
---|
36 | virtual void process(const Event &event); |
---|
37 | |
---|
38 | |
---|
39 | |
---|
40 | private: |
---|
41 | void init(); |
---|
42 | void calculateVelocity(float time); |
---|
43 | |
---|
44 | bool bUp; //!< up button pressed. |
---|
45 | bool bDown; //!< down button pressed. |
---|
46 | bool bLeft; //!< left button pressed. |
---|
47 | bool bRight; //!< right button pressed. |
---|
48 | bool bAscend; //!< ascend button pressed. |
---|
49 | bool bDescend; //!< descend button presses. |
---|
50 | bool bFire; //!< fire button pressed. |
---|
51 | bool bRollL; //!< rolling button pressed (left) |
---|
52 | bool bRollR; //!< rolling button pressed (right) |
---|
53 | |
---|
54 | float xMouse; //!< mouse moved in x-Direction |
---|
55 | float yMouse; //!< mouse moved in y-Direction |
---|
56 | int yInvert; |
---|
57 | float mouseSensitivity; //!< the mouse sensitivity |
---|
58 | int controlVelocityX; //!< defines max velocity of Xaxis of mousecontrol |
---|
59 | int controlVelocityY; //!< defines max velocity of Yaxis of mousecontrol |
---|
60 | |
---|
61 | PNode topRotor; //!< the position of the toprotor |
---|
62 | PNode tailRotor; //!< the position of the tailrotor |
---|
63 | |
---|
64 | PNode cameraNode; //!< the position the camera is locked at (used to look up and down without turning the helicopter) |
---|
65 | |
---|
66 | Vector velocity; //!< the velocity of the player. |
---|
67 | Vector velocityDir; //!< the direction of the velocity of the spaceship |
---|
68 | float travelSpeed; //!< the current speed of the player (to make soft movement) |
---|
69 | float acceleration; //!< the acceleration of the player. |
---|
70 | |
---|
71 | float airViscosity; |
---|
72 | |
---|
73 | }; |
---|
74 | |
---|
75 | #endif /* _HELICOPTERS_H */ |
---|