[5996] | 1 | |
---|
| 2 | /*! |
---|
[9039] | 3 | * @file cruizer.h |
---|
| 4 | * Implements the Control of a Cruizer |
---|
[5996] | 5 | */ |
---|
| 6 | |
---|
[9039] | 7 | #ifndef _CRUIZER_H |
---|
| 8 | #define _CRUIZER_H |
---|
[5996] | 9 | |
---|
| 10 | #include "playable.h" |
---|
| 11 | |
---|
[7001] | 12 | // Forward Declaration |
---|
| 13 | class ParticleEmitter; |
---|
| 14 | class ParticleSystem; |
---|
| 15 | |
---|
[9039] | 16 | class Cruizer : public Playable |
---|
[5996] | 17 | { |
---|
| 18 | public: |
---|
[9039] | 19 | Cruizer(const std::string& fileName); |
---|
| 20 | Cruizer(const TiXmlElement* root = NULL); |
---|
| 21 | virtual ~Cruizer(); |
---|
[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 | |
---|
[6724] | 52 | PNode cameraNode; |
---|
[6807] | 53 | float cameraLook; |
---|
| 54 | float rotation; |
---|
[5996] | 55 | |
---|
[9039] | 56 | // Vector velocity; //!< the velocity of the Cruizer. |
---|
| 57 | Quaternion direction; //!< the direction of the Cruizer. |
---|
[6805] | 58 | float travelSpeed; //!< the current speed of the Hove (to make soft movement) |
---|
[9039] | 59 | float acceleration; //!< the acceleration of the Cruizer. |
---|
[6999] | 60 | float airFriction; //!< AirFriction. |
---|
[6222] | 61 | |
---|
[6806] | 62 | float rotorSpeed; //!< the speed of the rotor. |
---|
| 63 | float rotorCycle; //!< The Cycle the rotor is in. |
---|
| 64 | |
---|
[6162] | 65 | float airViscosity; |
---|
[5996] | 66 | |
---|
[9044] | 67 | ParticleEmitter* burstEmitter; |
---|
[7001] | 68 | ParticleSystem* burstSystem; |
---|
[5996] | 69 | }; |
---|
| 70 | |
---|
[9039] | 71 | #endif /* _CRUIZERS_H */ |
---|