Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/space_ships/space_ship.h @ 6807

Last change on this file since 6807 was 6807, checked in by bensch, 18 years ago

trunk: hover optimize

File size: 3.0 KB
Line 
1/*!
2 * @file space_ship.h
3 * Implements the Control of a Spaceship
4 */
5
6#ifndef _SPACE_SHIP_H
7#define _SPACE_SHIP_H
8
9#include "playable.h"
10#include "extendable.h"
11
12// Forward Declaration
13template<class T> class tList;
14class Vector;
15class Event;
16class ParticleEmitter;
17class ParticleSystem;
18
19class SpaceShip : public Playable
20{
21
22  public:
23    SpaceShip(const char* fileName);
24    SpaceShip(const TiXmlElement* root = NULL);
25    virtual ~SpaceShip();
26
27    virtual void loadParams(const TiXmlElement* root);
28
29    virtual void enter();
30    virtual void leave();
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    virtual int       writeBytes(const byte* data, int length, int sender);
42    virtual int       readBytes(byte* data, int maxLength, int * reciever);
43
44
45  private:
46    void init();
47
48    void calculateVelocity(float time);
49
50    // !! temporary !!
51    void ADDWEAPON();
52
53    bool                  bUp;                //!< up button pressed.
54    bool                  bDown;              //!< down button pressed.
55    bool                  bLeft;              //!< left button pressed.
56    bool                  bRight;             //!< right button pressed.
57    bool                  bAscend;            //!< ascend button pressed.
58    bool                  bDescend;           //!< descend button presses.
59    bool                  bFire;              //!< fire button pressed.
60    bool                  bRollL;             //!< rolling button pressed (left)
61    bool                  bRollR;             //!< rolling button pressed (right)
62
63    float                 xMouse;             //!< mouse moved in x-Direction
64    float                 yMouse;             //!< mouse moved in y-Direction
65    float                 mouseSensitivity;   //!< the mouse sensitivity
66    int                   yInvert;
67    int                   controlVelocityX;
68    int                   controlVelocityY;
69//    float                 cycle;              //!< hovercycle
70
71    Vector                velocity;           //!< the velocity of the player.
72    Quaternion            mouseDir;           //!< the direction where the player wants to fly
73    Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
74    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
75    Quaternion            rotQuat;
76    Quaternion            pitchDir;
77    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
78    float                 acceleration;       //!< the acceleration of the player.
79
80    float                 airViscosity;
81
82    int oldMask;
83
84    ParticleEmitter*      burstEmitter;
85    ParticleSystem*       burstSystem;
86};
87
88#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.