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