[5996] | 1 | |
---|
| 2 | /*! |
---|
[6799] | 3 | * @file hover.h |
---|
| 4 | * Implements the Control of a Hover |
---|
[5996] | 5 | */ |
---|
| 6 | |
---|
[6799] | 7 | #ifndef _HOVER_H |
---|
| 8 | #define _HOVER_H |
---|
[5996] | 9 | |
---|
| 10 | #include "playable.h" |
---|
| 11 | |
---|
[6799] | 12 | class Hover : public Playable |
---|
[5996] | 13 | { |
---|
| 14 | public: |
---|
| 15 | |
---|
[7221] | 16 | Hover(const std::string& fileName); |
---|
[6803] | 17 | Hover(const TiXmlElement* root = NULL); |
---|
[6799] | 18 | virtual ~Hover(); |
---|
[5996] | 19 | |
---|
[6512] | 20 | virtual void loadParams(const TiXmlElement* root); |
---|
[7346] | 21 | virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) {/* FIXME */}; |
---|
[5996] | 22 | |
---|
[6222] | 23 | virtual void enter(); |
---|
| 24 | virtual void leave(); |
---|
| 25 | |
---|
[5996] | 26 | virtual void postSpawn(); |
---|
| 27 | virtual void leftWorld(); |
---|
| 28 | |
---|
| 29 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
[6806] | 30 | virtual void tick(float dt); |
---|
[6005] | 31 | virtual void draw() const; |
---|
[5996] | 32 | |
---|
| 33 | virtual void process(const Event &event); |
---|
| 34 | |
---|
| 35 | private: |
---|
[6803] | 36 | void init(); |
---|
[6806] | 37 | void movement(float dt); |
---|
[6803] | 38 | |
---|
| 39 | private: |
---|
[6805] | 40 | bool bForward; //!< forward button pressed. |
---|
| 41 | bool bBackward; //!< backward button pressed. |
---|
[5996] | 42 | bool bLeft; //!< left button pressed. |
---|
| 43 | bool bRight; //!< right button pressed. |
---|
| 44 | bool bAscend; //!< ascend button pressed. |
---|
| 45 | bool bDescend; //!< descend button presses. |
---|
| 46 | |
---|
[6637] | 47 | int yInvert; |
---|
[5996] | 48 | float mouseSensitivity; //!< the mouse sensitivity |
---|
[6799] | 49 | |
---|
[6800] | 50 | PNode wingNodeLeft; |
---|
| 51 | PNode wingNodeRight; |
---|
| 52 | PNode rotorNodeLeft; |
---|
| 53 | PNode rotorNodeRight; |
---|
[6799] | 54 | |
---|
[6724] | 55 | PNode cameraNode; |
---|
[6807] | 56 | float cameraLook; |
---|
| 57 | float rotation; |
---|
[5996] | 58 | |
---|
[6805] | 59 | Vector velocity; //!< the velocity of the Hover. |
---|
| 60 | Quaternion direction; //!< the direction of the Hover. |
---|
| 61 | float travelSpeed; //!< the current speed of the Hove (to make soft movement) |
---|
| 62 | float acceleration; //!< the acceleration of the Hover. |
---|
[6999] | 63 | float airFriction; //!< AirFriction. |
---|
[6222] | 64 | |
---|
[6806] | 65 | float rotorSpeed; //!< the speed of the rotor. |
---|
| 66 | float rotorCycle; //!< The Cycle the rotor is in. |
---|
| 67 | |
---|
[6162] | 68 | float airViscosity; |
---|
[5996] | 69 | |
---|
[7072] | 70 | WorldEntity* hitEntity; |
---|
[5996] | 71 | }; |
---|
| 72 | |
---|
[6799] | 73 | #endif /* _HOVERS_H */ |
---|