Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

spaceship collides with arena

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