Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

trunk: merged network branche into trunk

File size: 3.3 KB
RevLine 
[6034]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"
[6243]10#include "extendable.h"
[6034]11
[6756]12// Forward Declaration
[6034]13template<class T> class tList;
14class Vector;
15class Event;
[6756]16class ParticleEmitter;
17class ParticleSystem;
[6034]18
[6547]19class SpaceShip : public Playable
[6034]20{
21
22  public:
23    SpaceShip(const char* fileName);
[6807]24    SpaceShip(const TiXmlElement* root = NULL);
[6034]25    virtual ~SpaceShip();
26
[6512]27    virtual void loadParams(const TiXmlElement* root);
[6034]28
[6222]29    virtual void enter();
30    virtual void leave();
31
[6034]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
[6424]41    virtual int       writeBytes(const byte* data, int length, int sender);
42    virtual int       readBytes(byte* data, int maxLength, int * reciever);
[6034]43
44  private:
[6804]45    void init();
[6034]46
47    void calculateVelocity(float time);
48
[6959]49    void doCollideNetwork( float energy );
50
[6034]51    // !! temporary !!
52    void ADDWEAPON();
53
54    bool                  bUp;                //!< up button pressed.
55    bool                  bDown;              //!< down button pressed.
56    bool                  bLeft;              //!< left button pressed.
57    bool                  bRight;             //!< right button pressed.
58    bool                  bAscend;            //!< ascend button pressed.
59    bool                  bDescend;           //!< descend button presses.
[6868]60//    bool                  bFire;              //!< fire button pressed.(moved to playable)
[6034]61    bool                  bRollL;             //!< rolling button pressed (left)
62    bool                  bRollR;             //!< rolling button pressed (right)
63
64    float                 xMouse;             //!< mouse moved in x-Direction
65    float                 yMouse;             //!< mouse moved in y-Direction
66    float                 mouseSensitivity;   //!< the mouse sensitivity
[6637]67    int                   yInvert;
68    int                   controlVelocityX;
69    int                   controlVelocityY;
70//    float                 cycle;              //!< hovercycle
[6034]71
72    Vector                velocity;           //!< the velocity of the player.
[6815]73    Vector                oldVelocity;        //!< the velocity the player had last synced
[6162]74    Quaternion            mouseDir;           //!< the direction where the player wants to fly
[6737]75    Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
[6637]76    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
[6426]77    Quaternion            rotQuat;
[6637]78    Quaternion            pitchDir;
[6034]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
[6868]84    byte                  oldMask;            //!< used for synchronisation
[6634]85
[6756]86    ParticleEmitter*      burstEmitter;
87    ParticleSystem*       burstSystem;
[6959]88
89    std::list<float>        networkCollisionList;
[6034]90};
91
92#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.