Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.h @ 6544

Last change on this file since 6544 was 6544, checked in by snellen, 18 years ago

space_ship.cc updated

File size: 2.8 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
13template<class T> class tList;
14class Vector;
15class Event;
16
17class SpaceShip : public Playable, public Extendable
18{
19
20  public:
21
22    SpaceShip();
23    SpaceShip(const char* fileName);
24    SpaceShip(const TiXmlElement* root);
25    virtual ~SpaceShip();
26
27    void init();
28    void loadParams(const TiXmlElement* root);
29
30    virtual void enter();
31    virtual void leave();
32
33    virtual void postSpawn();
34    virtual void leftWorld();
35
36    virtual void collidesWith(WorldEntity* entity, const Vector& location);
37    virtual void tick(float time);
38    virtual void draw() const;
39
40    virtual void process(const Event &event);
41    bool pickup(PowerUp* powerUp);
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
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                   controlVelocityX;
69    int                   controlVelocityY;
70//    float                 cycle;              //!< hovercycle
71
72    Vector                velocity;           //!< the velocity of the player.
73    Quaternion            mouseDir;           //!< the direction where the player wants to fly
74    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
75    Quaternion            rotQuat;
76    Quaternion            pitchDir;
77    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
78    float                 acceleration;       //!< the acceleration of the player.
79
80    float                 airViscosity;
81
82};
83
84#endif /* _SPACE_SHIPS_H */
Note: See TracBrowser for help on using the repository browser.