Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/hud/src/world_entities/creatures/fps_player.h @ 10649

Last change on this file since 10649 was 10647, checked in by bknecht, 18 years ago

Camera:

  • Added new ViewMode ViewFPS

FPSPlayer:

  • fixed crosshair bug

FPSPlayer/KeyMapper/Globals:

  • started to implement crouch function
File size: 2.0 KB
Line 
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
13class AimingSystem;
14
15
16class FPSPlayer : public Playable
17{
18  ObjectListDeclaration(FPSPlayer);
19
20  public:
21    FPSPlayer(const TiXmlElement* root = NULL);
22    virtual ~FPSPlayer();
23
24    virtual void loadParams(const TiXmlElement* root);
25
26    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
27
28    virtual void enter();
29    virtual void leave();
30
31    virtual void reset();
32
33    virtual void destroy(WorldEntity* killer);
34    virtual void respawn();
35
36    virtual void tick(float time);
37    virtual void draw() const;
38
39
40    virtual void process(const Event &event);
41
42  private:
43    void init();
44
45    bool                  bLeft;             //!< strafe left
46    bool                  bRight;            //!< strafe right
47    bool                  bForward;          //!< walk forward
48    bool                  bBackward;         //!< walk backward
49    bool                  bJump;             //!< jumping
50    bool                  bPosBut;           //!< position button
51    bool                  bFire;             //!< fire button
52    bool                  bCrouch;           //!< crouch button
53
54    float                 xMouse;            //!< mouse moved in x-Direction
55    float                 yMouse;            //!< mouse moved in y-Direction
56
57
58    float                 heading;           //!< the direction where the player heads to
59    float                 attitude;          //!< defines the camera angle to the x-z-plane
60
61    PNode                 cameraNode;        //!< the "eyes" of the player (or call it head if you want)
62
63    float                 fallVelocity;      //!< velocity for falling down
64    float                 jumpAcceleration;  //!< the jump acceleration
65
66    bool                  initWeapon;
67
68    AimingSystem*         aimingSystem;      //!< aiming system of the player
69
70    float                 damageTicker;      //!< ticker for dealing damage
71   
72};
73
74#endif
Note: See TracBrowser for help on using the repository browser.