Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/space_ships/helicopter.h @ 6805

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

orxonox/trunk: hover works as it should

File size: 2.5 KB
Line 
1
2/*!
3 * @file helicopter.h
4 * Implements the Control of a Helicopter
5 */
6
7#ifndef _HELICOPTER_H
8#define _HELICOPTER_H
9
10#include "playable.h"
11
12
13class Helicopter : public Playable
14{
15
16  public:
17
18    Helicopter();
19    Helicopter(const char* fileName);
20    Helicopter(const TiXmlElement* root);
21    virtual ~Helicopter();
22
23    virtual void loadParams(const TiXmlElement* root);
24
25    virtual void enter();
26    virtual void leave();
27    virtual void attachCamera();
28
29    virtual void postSpawn();
30    virtual void leftWorld();
31
32    virtual void collidesWith(WorldEntity* entity, const Vector& location);
33    virtual void tick(float time);
34    virtual void draw() const;
35
36    virtual void process(const Event &event);
37
38
39
40  private:
41    void init();
42    void calculateVelocity(float time);
43
44    bool                  bUp;                //!< up button pressed.
45    bool                  bDown;              //!< down button pressed.
46    bool                  bLeft;              //!< left button pressed.
47    bool                  bRight;             //!< right button pressed.
48    bool                  bAscend;            //!< ascend button pressed.
49    bool                  bDescend;           //!< descend button presses.
50    bool                  bFire;              //!< fire button pressed.
51    bool                  bRollL;             //!< rolling button pressed (left)
52    bool                  bRollR;             //!< rolling button pressed (right)
53
54    float                 xMouse;             //!< mouse moved in x-Direction
55    float                 yMouse;             //!< mouse moved in y-Direction
56    int                   yInvert;
57    float                 mouseSensitivity;   //!< the mouse sensitivity
58    int                   controlVelocityX;
59    int                   controlVelocityY;
60    //float                 cycle;              //!< hovercycle
61
62    PNode                 topRotor;
63    PNode                 tailRotor;
64
65    PNode                 cameraNode;
66
67    Vector                velocity;           //!< the velocity of the player.
68    Vector                velocityDir;        //!< the direction of the velocity of the spaceship
69    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
70    float                 acceleration;       //!< the acceleration of the player.
71    //float                 rotorspeed;         //!< the speed of the rotor.
72    //float                 tailrotorspeed;     //!< the relativ speed ot the tail rotor
73
74    float                 airViscosity;
75
76};
77
78#endif /* _HELICOPTERS_H */
Note: See TracBrowser for help on using the repository browser.