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 char* fileName); |
---|
20 | Helicopter(const TiXmlElement* root); |
---|
21 | virtual ~Helicopter(); |
---|
22 | |
---|
23 | virtual void loadParams(const TiXmlElement* root); |
---|
24 | |
---|
25 | virtual void enter(); |
---|
26 | virtual void leave(); |
---|
27 | |
---|
28 | virtual void postSpawn(); |
---|
29 | virtual void leftWorld(); |
---|
30 | |
---|
31 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
32 | virtual void tick(float time); |
---|
33 | virtual void draw() const; |
---|
34 | |
---|
35 | virtual void process(const Event &event); |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | private: |
---|
40 | void init(); |
---|
41 | void calculateVelocity(float time); |
---|
42 | |
---|
43 | bool bUp; //!< up button pressed. |
---|
44 | bool bDown; //!< down button pressed. |
---|
45 | bool bLeft; //!< left button pressed. |
---|
46 | bool bRight; //!< right button pressed. |
---|
47 | bool bAscend; //!< ascend button pressed. |
---|
48 | bool bDescend; //!< descend button presses. |
---|
49 | bool bFire; //!< fire button pressed. |
---|
50 | bool bRollL; //!< rolling button pressed (left) |
---|
51 | bool bRollR; //!< rolling button pressed (right) |
---|
52 | |
---|
53 | float xMouse; //!< mouse moved in x-Direction |
---|
54 | float yMouse; //!< mouse moved in y-Direction |
---|
55 | int yInvert; |
---|
56 | float mouseSensitivity; //!< the mouse sensitivity |
---|
57 | int controlVelocityX; |
---|
58 | int controlVelocityY; |
---|
59 | //float cycle; //!< hovercycle |
---|
60 | |
---|
61 | PNode topRotor; |
---|
62 | PNode tailRotor; |
---|
63 | |
---|
64 | PNode cameraNode; |
---|
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 | //float rotorspeed; //!< the speed of the rotor. |
---|
71 | //float tailrotorspeed; //!< the relativ speed ot the tail rotor |
---|
72 | |
---|
73 | float airViscosity; |
---|
74 | |
---|
75 | }; |
---|
76 | |
---|
77 | #endif /* _HELICOPTERS_H */ |
---|