Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

fixed the direction loading of spaceship

File size: 3.3 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    void setRelDir(float angle, float axisX, float axisY, float axisZ);
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  private:
47    void init();
48
49    void calculateVelocity(float time);
50
51    void doCollideNetwork( float energy );
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.(moved to playable)
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    Vector                oldVelocity;        //!< the velocity the player had last synced
73    Quaternion            mouseDir;           //!< the direction where the player wants to fly
74    Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
75    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
76    Quaternion            rotQuat;
77    Quaternion            pitchDir;
78    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
79    float                 acceleration;       //!< the acceleration of the player.
80
81    float                 airViscosity;
82
83    byte                  oldMask;            //!< used for synchronisation
84
85    ParticleEmitter*      burstEmitter;
86    ParticleSystem*       burstSystem;
87
88    std::list<float>        networkCollisionList;
89};
90
91#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.