Rev | Line | |
---|
[8685] | 1 | /*! |
---|
| 2 | * @file fps_player.h |
---|
| 3 | * Implements a playable for fps games |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #ifndef _FPS_PLAYER_H |
---|
| 7 | #define _FPS_PLAYER_H |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | #include "playable.h" |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | class FPSPlayer : public Playable |
---|
| 14 | { |
---|
| 15 | |
---|
| 16 | public: |
---|
| 17 | FPSPlayer(const TiXmlElement* root = NULL); |
---|
| 18 | virtual ~FPSPlayer(); |
---|
| 19 | |
---|
| 20 | virtual void loadParams(const TiXmlElement* root); |
---|
| 21 | |
---|
| 22 | virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); |
---|
| 23 | |
---|
| 24 | virtual void enter(); |
---|
| 25 | virtual void leave(); |
---|
| 26 | |
---|
| 27 | virtual void reset(); |
---|
[9122] | 28 | |
---|
[9150] | 29 | virtual void respawn(); |
---|
[8685] | 30 | |
---|
| 31 | virtual void tick(float time); |
---|
[8686] | 32 | virtual void draw() const; |
---|
[8685] | 33 | |
---|
[8686] | 34 | |
---|
[8685] | 35 | virtual void process(const Event &event); |
---|
| 36 | |
---|
| 37 | private: |
---|
| 38 | void init(); |
---|
| 39 | |
---|
| 40 | bool bLeft; |
---|
| 41 | bool bRight; |
---|
| 42 | bool bForward; |
---|
| 43 | bool bBackward; |
---|
| 44 | bool bJump; //!< jumping |
---|
[9003] | 45 | bool bPosBut; //!< position button |
---|
[8685] | 46 | |
---|
| 47 | float xMouse; //!< mouse moved in x-Direction |
---|
| 48 | float yMouse; //!< mouse moved in y-Direction |
---|
| 49 | |
---|
| 50 | |
---|
[8731] | 51 | float heading; |
---|
| 52 | float attitude; |
---|
| 53 | |
---|
| 54 | PNode cameraNode; |
---|
[9003] | 55 | |
---|
| 56 | float fallVelocity; //!< velocity for falling down |
---|
[9110] | 57 | float jumpForce; //!< the jump force |
---|
[9139] | 58 | |
---|
| 59 | bool initWeapon; |
---|
[8685] | 60 | }; |
---|
| 61 | |
---|
| 62 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.