[5996] | 1 | |
---|
| 2 | /*! |
---|
[6002] | 3 | * @file helicopter.h |
---|
| 4 | * Implements the Control of a Helicopter |
---|
[5996] | 5 | */ |
---|
| 6 | |
---|
[6002] | 7 | #ifndef _HELICOPTER_H |
---|
| 8 | #define _HELICOPTER_H |
---|
[5996] | 9 | |
---|
| 10 | #include "playable.h" |
---|
| 11 | |
---|
| 12 | |
---|
[6002] | 13 | class Helicopter : public Playable |
---|
[5996] | 14 | { |
---|
| 15 | |
---|
| 16 | public: |
---|
| 17 | |
---|
[6002] | 18 | Helicopter(); |
---|
| 19 | Helicopter(const char* fileName); |
---|
| 20 | Helicopter(const TiXmlElement* root); |
---|
| 21 | virtual ~Helicopter(); |
---|
[5996] | 22 | |
---|
[6512] | 23 | virtual void loadParams(const TiXmlElement* root); |
---|
[5996] | 24 | |
---|
[6222] | 25 | virtual void enter(); |
---|
| 26 | virtual void leave(); |
---|
| 27 | |
---|
[5996] | 28 | virtual void postSpawn(); |
---|
| 29 | virtual void leftWorld(); |
---|
| 30 | |
---|
| 31 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
| 32 | virtual void tick(float time); |
---|
[6005] | 33 | virtual void draw() const; |
---|
[5996] | 34 | |
---|
| 35 | virtual void process(const Event &event); |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | private: |
---|
[6804] | 40 | void init(); |
---|
[5996] | 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 |
---|
[6637] | 55 | int yInvert; |
---|
[5996] | 56 | float mouseSensitivity; //!< the mouse sensitivity |
---|
[6724] | 57 | int controlVelocityX; |
---|
| 58 | int controlVelocityY; |
---|
[6637] | 59 | //float cycle; //!< hovercycle |
---|
[6804] | 60 | |
---|
[6724] | 61 | PNode topRotor; |
---|
| 62 | PNode tailRotor; |
---|
[6804] | 63 | |
---|
[6724] | 64 | PNode cameraNode; |
---|
[5996] | 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. |
---|
[6637] | 70 | //float rotorspeed; //!< the speed of the rotor. |
---|
| 71 | //float tailrotorspeed; //!< the relativ speed ot the tail rotor |
---|
[6222] | 72 | |
---|
[6162] | 73 | float airViscosity; |
---|
[5996] | 74 | |
---|
| 75 | }; |
---|
| 76 | |
---|
[6002] | 77 | #endif /* _HELICOPTERS_H */ |
---|