Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/test/src/world_entities/space_ships/spacecraft_2d.h

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

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

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