[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 | |
---|
[9656] | 12 | #include "color.h" |
---|
| 13 | |
---|
[7001] | 14 | // Forward Declaration |
---|
| 15 | class ParticleEmitter; |
---|
| 16 | class ParticleSystem; |
---|
| 17 | |
---|
[7000] | 18 | class TurbineHover : public Playable |
---|
[5996] | 19 | { |
---|
[9869] | 20 | ObjectListDeclaration(TurbineHover); |
---|
| 21 | public: |
---|
| 22 | TurbineHover(const std::string& fileName); |
---|
| 23 | TurbineHover(const TiXmlElement* root = NULL); |
---|
| 24 | virtual ~TurbineHover(); |
---|
[5996] | 25 | |
---|
[9869] | 26 | void setBoostColor(const Color& color); |
---|
[9656] | 27 | |
---|
[9869] | 28 | virtual void loadParams(const TiXmlElement* root); |
---|
| 29 | virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); |
---|
| 30 | virtual void enter(); |
---|
| 31 | virtual void leave(); |
---|
[6222] | 32 | |
---|
[9869] | 33 | virtual void setTeam(int teamID); |
---|
[9656] | 34 | |
---|
[9869] | 35 | virtual void postSpawn(); |
---|
| 36 | virtual void leftWorld(); |
---|
| 37 | virtual void respawn(); |
---|
[5996] | 38 | |
---|
[9869] | 39 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
| 40 | virtual void tick(float dt); |
---|
| 41 | virtual void draw() const; |
---|
[5996] | 42 | |
---|
[9869] | 43 | virtual void process(const Event &event); |
---|
[5996] | 44 | |
---|
[9869] | 45 | private: |
---|
| 46 | void init(); |
---|
| 47 | void movement(float dt); |
---|
[6803] | 48 | |
---|
[9869] | 49 | private: |
---|
| 50 | bool bForward; //!< forward button pressed. |
---|
| 51 | bool bBackward; //!< backward button pressed. |
---|
| 52 | bool bLeft; //!< left button pressed. |
---|
| 53 | bool bRight; //!< right button pressed. |
---|
| 54 | bool bAscend; //!< ascend button pressed. |
---|
| 55 | bool bDescend; //!< descend button presses. |
---|
[5996] | 56 | |
---|
[9869] | 57 | int yInvert; |
---|
| 58 | float mouseSensitivity; //!< the mouse sensitivity |
---|
[6799] | 59 | |
---|
[9869] | 60 | PNode wingNodeLeft; |
---|
| 61 | PNode wingNodeRight; |
---|
| 62 | PNode rotorNodeLeft; |
---|
| 63 | PNode rotorNodeRight; |
---|
[6799] | 64 | |
---|
[9869] | 65 | PNode cameraNode; |
---|
| 66 | float cameraLook; |
---|
| 67 | float rotation; |
---|
[5996] | 68 | |
---|
[9869] | 69 | // Vector velocity; //!< the velocity of the TurbineHover. |
---|
| 70 | Quaternion direction; //!< the direction of the TurbineHover. |
---|
| 71 | float travelSpeed; //!< the current speed of the Hove (to make soft movement) |
---|
| 72 | float acceleration; //!< the acceleration of the TurbineHover. |
---|
| 73 | float airFriction; //!< AirFriction. |
---|
[6222] | 74 | |
---|
[9869] | 75 | float rotorSpeed; //!< the speed of the rotor. |
---|
| 76 | float rotorCycle; //!< The Cycle the rotor is in. |
---|
[6806] | 77 | |
---|
[9869] | 78 | float airViscosity; |
---|
[5996] | 79 | |
---|
[9869] | 80 | ParticleEmitter* burstEmitter[2]; |
---|
| 81 | ParticleSystem* burstSystem; |
---|
[5996] | 82 | }; |
---|
| 83 | |
---|
[7000] | 84 | #endif /* _TURBINE_HOVERS_H */ |
---|