[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 | |
---|
[9235] | 10 | //#include "sound_buffer.h" |
---|
| 11 | //#include "sound_source.h" |
---|
| 12 | |
---|
[5996] | 13 | #include "playable.h" |
---|
| 14 | |
---|
[6799] | 15 | class Hover : public Playable |
---|
[5996] | 16 | { |
---|
[9869] | 17 | ObjectListDeclaration(Hover); |
---|
[5996] | 18 | public: |
---|
| 19 | |
---|
[7221] | 20 | Hover(const std::string& fileName); |
---|
[6803] | 21 | Hover(const TiXmlElement* root = NULL); |
---|
[6799] | 22 | virtual ~Hover(); |
---|
[5996] | 23 | |
---|
[6512] | 24 | virtual void loadParams(const TiXmlElement* root); |
---|
[7346] | 25 | virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) {/* FIXME */}; |
---|
[5996] | 26 | |
---|
[6222] | 27 | virtual void enter(); |
---|
| 28 | virtual void leave(); |
---|
| 29 | |
---|
[5996] | 30 | virtual void postSpawn(); |
---|
| 31 | virtual void leftWorld(); |
---|
| 32 | |
---|
| 33 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
[6806] | 34 | virtual void tick(float dt); |
---|
[6005] | 35 | virtual void draw() const; |
---|
[5996] | 36 | |
---|
| 37 | virtual void process(const Event &event); |
---|
| 38 | |
---|
| 39 | private: |
---|
[6803] | 40 | void init(); |
---|
[6806] | 41 | void movement(float dt); |
---|
[6803] | 42 | |
---|
| 43 | private: |
---|
[6805] | 44 | bool bForward; //!< forward button pressed. |
---|
| 45 | bool bBackward; //!< backward button pressed. |
---|
[5996] | 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 | |
---|
[6637] | 51 | int yInvert; |
---|
[5996] | 52 | float mouseSensitivity; //!< the mouse sensitivity |
---|
[6799] | 53 | |
---|
[6800] | 54 | PNode wingNodeLeft; |
---|
| 55 | PNode wingNodeRight; |
---|
| 56 | PNode rotorNodeLeft; |
---|
| 57 | PNode rotorNodeRight; |
---|
[6799] | 58 | |
---|
[6724] | 59 | PNode cameraNode; |
---|
[6807] | 60 | float cameraLook; |
---|
| 61 | float rotation; |
---|
[5996] | 62 | |
---|
[6805] | 63 | Vector velocity; //!< the velocity of the Hover. |
---|
| 64 | Quaternion direction; //!< the direction of the Hover. |
---|
| 65 | float travelSpeed; //!< the current speed of the Hove (to make soft movement) |
---|
| 66 | float acceleration; //!< the acceleration of the Hover. |
---|
[6999] | 67 | float airFriction; //!< AirFriction. |
---|
[6222] | 68 | |
---|
[6806] | 69 | float rotorSpeed; //!< the speed of the rotor. |
---|
| 70 | float rotorCycle; //!< The Cycle the rotor is in. |
---|
| 71 | |
---|
[6162] | 72 | float airViscosity; |
---|
[5996] | 73 | |
---|
[9235] | 74 | WorldEntity* hitEntity; |
---|
| 75 | |
---|
| 76 | //OrxSound::SoundSource soundSource; |
---|
| 77 | //OrxSound::SoundBuffer* hoverBuffer; |
---|
[5996] | 78 | }; |
---|
| 79 | |
---|
[6799] | 80 | #endif /* _HOVERS_H */ |
---|