Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/space_ships/spacecraft_2d.h @ 9235

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

merged the presentation back

File size: 2.4 KB
RevLine 
[5996]1
2/*!
[9045]3 * @file spacecraft_2d.h
4 * Implements the Control of a Spacecraft2D
[5996]5 */
6
[9045]7#ifndef _SPACECRAFT_2D_H
8#define _SPACECRAFT_2D_H
[5996]9
10#include "playable.h"
11
[7001]12// Forward Declaration
13class ParticleEmitter;
14class ParticleSystem;
15
[9045]16class Spacecraft2D : public Playable
[5996]17{
18  public:
[9045]19    Spacecraft2D(const std::string& fileName);
20    Spacecraft2D(const TiXmlElement* root = NULL);
21    virtual ~Spacecraft2D();
[5996]22
[6512]23    virtual void loadParams(const TiXmlElement* root);
[9110]24
[9052]25    void setTravelSpeed(float travelSpeed);
[9110]26    void setTravelHeight(float travelHeight);
27    void setTravelDistance(const Vector2D& distance);
28    void setTravelDistance(float x, float y);
[9052]29
[9235]30    void setAirFriction(float friction) { this->airFriction = friction; };
[9110]31
[9235]32
[9110]33    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
[6222]34    virtual void enter();
35    virtual void leave();
36
[9052]37
[5996]38    virtual void postSpawn();
39    virtual void leftWorld();
40
41    virtual void collidesWith(WorldEntity* entity, const Vector& location);
[6806]42    virtual void tick(float dt);
[6005]43    virtual void draw() const;
[5996]44
45    virtual void process(const Event &event);
46
[9110]47  protected:
48    virtual void enterPlaymode(Playable::Playmode playmode);
49
[5996]50  private:
[6803]51    void init();
[6806]52    void movement(float dt);
[6803]53
54  private:
[6805]55    bool                  bForward;           //!< forward button pressed.
56    bool                  bBackward;          //!< backward button pressed.
[5996]57    bool                  bLeft;              //!< left button pressed.
58    bool                  bRight;             //!< right button pressed.
59
[6637]60    int                   yInvert;
[5996]61    float                 mouseSensitivity;   //!< the mouse sensitivity
[6799]62
[9110]63    /// Normal Movement.
64    Quaternion            direction;          //!< the direction of the Spacecraft2D.
65    float                 acceleration;       //!< the acceleration of the Spacecraft2D.
66    float                 airFriction;        //!< AirFriction.
[9052]67
[9110]68    float                 airViscosity;
[9052]69
70
[9110]71    /// 2D-traveling
72    PNode*                travelNode;
73    float*                toTravelHeight;
74    float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
75
76    Vector2D              travelDistance;     //!< Travel-Distance away from the TravelNode.
77
78    /// Camera
79    PNode                 cameraNode;
[6807]80    float                 cameraLook;
81    float                 rotation;
[5996]82
[6222]83
[9046]84    ParticleEmitter*      burstEmitter;
[7001]85    ParticleSystem*       burstSystem;
[5996]86};
87
[9045]88#endif /* _SPACECRAFT_2DS_H */
Note: See TracBrowser for help on using the repository browser.