Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

trunk: remastered Playables a bit

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
24    SpaceShip();
25    SpaceShip(const char* fileName);
26    SpaceShip(const TiXmlElement* root);
27    virtual ~SpaceShip();
28
29    virtual void loadParams(const TiXmlElement* root);
30
31    virtual void enter();
32    virtual void leave();
33
34    virtual void postSpawn();
35    virtual void leftWorld();
36
37    virtual void collidesWith(WorldEntity* entity, const Vector& location);
38    virtual void tick(float time);
39    virtual void draw() const;
40
41    virtual void process(const Event &event);
42
43    virtual int       writeBytes(const byte* data, int length, int sender);
44    virtual int       readBytes(byte* data, int maxLength, int * reciever);
45
46
47  private:
48    void init();
49
50    void calculateVelocity(float time);
51
52    // !! temporary !!
53    void ADDWEAPON();
54
55    bool                  bUp;                //!< up button pressed.
56    bool                  bDown;              //!< down button pressed.
57    bool                  bLeft;              //!< left button pressed.
58    bool                  bRight;             //!< right button pressed.
59    bool                  bAscend;            //!< ascend button pressed.
60    bool                  bDescend;           //!< descend button presses.
61    bool                  bFire;              //!< fire button pressed.
62    bool                  bRollL;             //!< rolling button pressed (left)
63    bool                  bRollR;             //!< rolling button pressed (right)
64
65    float                 xMouse;             //!< mouse moved in x-Direction
66    float                 yMouse;             //!< mouse moved in y-Direction
67    float                 mouseSensitivity;   //!< the mouse sensitivity
68    int                   yInvert;
69    int                   controlVelocityX;
70    int                   controlVelocityY;
71//    float                 cycle;              //!< hovercycle
72
73    Vector                velocity;           //!< the velocity of the player.
74    Quaternion            mouseDir;           //!< the direction where the player wants to fly
75    Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
76    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
77    Quaternion            rotQuat;
78    Quaternion            pitchDir;
79    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
80    float                 acceleration;       //!< the acceleration of the player.
81
82    float                 airViscosity;
83
84    int oldMask;
85
86    ParticleEmitter*      burstEmitter;
87    ParticleSystem*       burstSystem;
88};
89
90#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.