Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/christmas_branche/src/world_entities/creatures/md2_creature.h @ 6198

Last change on this file since 6198 was 6198, checked in by patrick, 18 years ago

christmas: better control now

File size: 2.6 KB
Line 
1/*!
2 * @file md2_creature.h
3 * Implements the control of a md2 model
4 */
5
6#ifndef _MD2_CREATURE_H
7#define _MD2_CREATURE_H
8
9#include "playable.h"
10
11
12template<class T> class tList;
13class Vector;
14class Event;
15
16class MD2Creature : public Playable
17{
18
19  public:
20
21    MD2Creature();
22    MD2Creature(const char* fileName);
23    MD2Creature(const TiXmlElement* root);
24    virtual ~MD2Creature();
25
26    void init();
27    void loadParams(const TiXmlElement* root);
28
29    void addWeapon(Weapon* weapon );
30    void removeWeapon(Weapon* weapon);
31
32    virtual void postSpawn();
33    virtual void leftWorld();
34
35    virtual void collidesWith(WorldEntity* entity, const Vector& location);
36    virtual void tick(float time);
37    virtual void draw() const;
38
39    virtual void process(const Event &event);
40
41
42
43  private:
44
45    void calculateVelocity(float time);
46    void weaponAction();
47
48    // !! temporary !!
49    void ADDWEAPON();
50
51    bool                  bUp;                //!< up button pressed.
52    bool                  bDown;              //!< down button pressed.
53    bool                  bLeft;              //!< left button pressed.
54    bool                  bRight;             //!< right button pressed.
55    bool                  bAscend;            //!< ascend button pressed.
56    bool                  bDescend;           //!< descend button presses.
57    bool                  bFire;              //!< fire button pressed.
58    bool                  bRollL;             //!< rolling button pressed (left)
59    bool                  bRollR;             //!< rolling button pressed (right)
60    bool                  bStrafeL;           //!< strafe to the left side
61    bool                  bStrafeR;           //!< strafe to the rith side
62    bool                  bJump;              //!< jump
63
64    float                 xMouse;             //!< mouse moved in x-Direction
65    float                 yMouse;             //!< mouse moved in y-Direction
66    float                 mouseSensitivity;   //!< the mouse sensitivity
67    float                 cycle;              //!< hovercycle
68
69    Vector                velocity;           //!< the velocity of the player.
70    Quaternion            mouseDir;           //!< the direction where the player wants to fly
71    Quaternion rotQuat;
72    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
73    float                 acceleration;       //!< the acceleration of the player.
74
75    float                 airViscosity;
76
77};
78
79#endif /* _MD2_CREATURE_H */
Note: See TracBrowser for help on using the repository browser.