Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/world_entities/space_ships/space_ship.h @ 6791

Last change on this file since 6791 was 6791, checked in by rennerc, 18 years ago

spaceship: fixed first atemp to fix strange movement

File size: 3.1 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    void init();
30    virtual void loadParams(const TiXmlElement* root);
31
32    virtual void enter();
33    virtual void leave();
34
35    virtual void postSpawn();
36    virtual void leftWorld();
37
38    virtual void collidesWith(WorldEntity* entity, const Vector& location);
39    virtual void tick(float time);
40    virtual void draw() const;
41
42    virtual void process(const Event &event);
43
44    virtual int       writeBytes(const byte* data, int length, int sender);
45    virtual int       readBytes(byte* data, int maxLength, int * reciever);
46
47  private:
48
49    void calculateVelocity(float time);
50    void weaponAction();
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    Vector                oldVelocity;        //!< the velocity the player had last synced
75    Quaternion            mouseDir;           //!< the direction where the player wants to fly
76    Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
77    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
78    Quaternion            rotQuat;
79    Quaternion            pitchDir;
80    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
81    float                 acceleration;       //!< the acceleration of the player.
82
83    float                 airViscosity;
84
85    int oldMask;
86
87    ParticleEmitter*      burstEmitter;
88    ParticleSystem*       burstSystem;
89};
90
91#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.