1 | |
---|
2 | /*! |
---|
3 | * @file hover.h |
---|
4 | * Implements the Control of a Hover |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _HOVER_H |
---|
8 | #define _HOVER_H |
---|
9 | |
---|
10 | //#include "sound_buffer.h" |
---|
11 | //#include "sound_source.h" |
---|
12 | |
---|
13 | #include "playable.h" |
---|
14 | |
---|
15 | class Hover : public Playable |
---|
16 | { |
---|
17 | ObjectListDeclaration(Hover); |
---|
18 | public: |
---|
19 | |
---|
20 | Hover(const std::string& fileName); |
---|
21 | Hover(const TiXmlElement* root = NULL); |
---|
22 | virtual ~Hover(); |
---|
23 | |
---|
24 | virtual void loadParams(const TiXmlElement* root); |
---|
25 | virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) {/* FIXME */}; |
---|
26 | |
---|
27 | virtual void enter(); |
---|
28 | virtual void leave(); |
---|
29 | |
---|
30 | virtual void postSpawn(); |
---|
31 | virtual void leftWorld(); |
---|
32 | |
---|
33 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
34 | virtual void tick(float dt); |
---|
35 | virtual void draw() const; |
---|
36 | |
---|
37 | virtual void process(const Event &event); |
---|
38 | |
---|
39 | private: |
---|
40 | void init(); |
---|
41 | void movement(float dt); |
---|
42 | |
---|
43 | private: |
---|
44 | bool bForward; //!< forward button pressed. |
---|
45 | bool bBackward; //!< backward button pressed. |
---|
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 | |
---|
51 | int yInvert; |
---|
52 | float mouseSensitivity; //!< the mouse sensitivity |
---|
53 | |
---|
54 | PNode wingNodeLeft; |
---|
55 | PNode wingNodeRight; |
---|
56 | PNode rotorNodeLeft; |
---|
57 | PNode rotorNodeRight; |
---|
58 | |
---|
59 | PNode cameraNode; |
---|
60 | float cameraLook; |
---|
61 | float rotation; |
---|
62 | |
---|
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. |
---|
67 | float airFriction; //!< AirFriction. |
---|
68 | |
---|
69 | float rotorSpeed; //!< the speed of the rotor. |
---|
70 | float rotorCycle; //!< The Cycle the rotor is in. |
---|
71 | |
---|
72 | float airViscosity; |
---|
73 | |
---|
74 | WorldEntity* hitEntity; |
---|
75 | |
---|
76 | //OrxSound::SoundSource soundSource; |
---|
77 | //OrxSound::SoundBuffer* hoverBuffer; |
---|
78 | }; |
---|
79 | |
---|
80 | #endif /* _HOVERS_H */ |
---|