[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 | { |
---|
[9869] | 18 | ObjectListDeclaration(Cruizer); |
---|
[5996] | 19 | public: |
---|
[9039] | 20 | Cruizer(const std::string& fileName); |
---|
| 21 | Cruizer(const TiXmlElement* root = NULL); |
---|
| 22 | virtual ~Cruizer(); |
---|
[5996] | 23 | |
---|
[6512] | 24 | virtual void loadParams(const TiXmlElement* root); |
---|
[7348] | 25 | virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); |
---|
[6222] | 26 | virtual void enter(); |
---|
| 27 | virtual void leave(); |
---|
| 28 | |
---|
[5996] | 29 | virtual void postSpawn(); |
---|
| 30 | virtual void leftWorld(); |
---|
| 31 | |
---|
| 32 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
[6806] | 33 | virtual void tick(float dt); |
---|
[6005] | 34 | virtual void draw() const; |
---|
[5996] | 35 | |
---|
| 36 | virtual void process(const Event &event); |
---|
| 37 | |
---|
| 38 | private: |
---|
[6803] | 39 | void init(); |
---|
[6806] | 40 | void movement(float dt); |
---|
[6803] | 41 | |
---|
| 42 | private: |
---|
[6805] | 43 | bool bForward; //!< forward button pressed. |
---|
| 44 | bool bBackward; //!< backward button pressed. |
---|
[5996] | 45 | bool bLeft; //!< left button pressed. |
---|
| 46 | bool bRight; //!< right button pressed. |
---|
| 47 | bool bAscend; //!< ascend button pressed. |
---|
| 48 | bool bDescend; //!< descend button presses. |
---|
| 49 | |
---|
[6637] | 50 | int yInvert; |
---|
[5996] | 51 | float mouseSensitivity; //!< the mouse sensitivity |
---|
[6799] | 52 | |
---|
[6724] | 53 | PNode cameraNode; |
---|
[6807] | 54 | float cameraLook; |
---|
| 55 | float rotation; |
---|
[5996] | 56 | |
---|
[9039] | 57 | // Vector velocity; //!< the velocity of the Cruizer. |
---|
| 58 | Quaternion direction; //!< the direction of the Cruizer. |
---|
[6805] | 59 | float travelSpeed; //!< the current speed of the Hove (to make soft movement) |
---|
[9039] | 60 | float acceleration; //!< the acceleration of the Cruizer. |
---|
[6999] | 61 | float airFriction; //!< AirFriction. |
---|
[6222] | 62 | |
---|
[6806] | 63 | float rotorSpeed; //!< the speed of the rotor. |
---|
| 64 | float rotorCycle; //!< The Cycle the rotor is in. |
---|
| 65 | |
---|
[6162] | 66 | float airViscosity; |
---|
[5996] | 67 | |
---|
[9044] | 68 | ParticleEmitter* burstEmitter; |
---|
[7001] | 69 | ParticleSystem* burstSystem; |
---|
[5996] | 70 | }; |
---|
| 71 | |
---|
[9039] | 72 | #endif /* _CRUIZERS_H */ |
---|