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