Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/tags/0.3.5_alpha/src/world_entities/npcs/gate.h @ 10365

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

merged the presentation back

File size: 1.2 KB
Line 
1#ifndef _GATE_H
2#define _GATE_H
3
4#include "world_entity.h"
5
6#include "md2/md2Model.h"
7
8class TiXmlElement;
9
10
11//! animation names enumeration
12typedef enum GateAnimType
13{
14  GATE_OPEN = 0,
15  GATE_CLOSE,
16  GATE_DIE,
17
18  GATE_MAX_ANIMATIONS
19};
20
21
22class Gate : public WorldEntity
23{
24  public:
25    Gate(const TiXmlElement* root = NULL);
26    virtual ~Gate ();
27
28    virtual void loadParams(const TiXmlElement* root);
29
30    void setActionRadius(float radius) { this->actionRadius = radius; }
31    void setScale(float scale) { this->scale = scale; }
32
33    void open();
34    void close();
35    void destroy();
36
37    void lock() { this->bLocked = true; }
38    void unlock() { this->bLocked = false; }
39    bool isLocked() const { return this->bLocked; }
40
41
42    virtual void tick (float time);
43
44
45  private:
46    void init();
47    bool checkOpen();
48    void setAnimation(int animNum, int playbackMode = 0);
49
50
51  private:
52    bool           bOpen;             //!< true if the door is open
53    bool           bLocked;           //!< true if this door is locked
54    float          actionRadius;      //!< action radius
55    float          scale;             //!< the scale of the model
56
57    static sAnim   animationList[3];  //!< list of the animations
58
59    bool           bDead;
60
61
62};
63
64#endif /* _GATE_H */
Note: See TracBrowser for help on using the repository browser.