Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/terrain/src/world_entities/npcs/gate.h @ 10632

Last change on this file since 10632 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: 1.3 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  ObjectListDeclaration(Gate);
25
26  public:
27    Gate(const TiXmlElement* root = NULL);
28    virtual ~Gate ();
29
30    virtual void loadParams(const TiXmlElement* root);
31
32    void setActionRadius(float radius) { this->actionRadius = radius; }
33    void setScale(float scale) { this->scale = scale; }
34
35    void open();
36    void close();
37    void destroy();
38
39    void lock() { this->bLocked = true; }
40    void unlock() { this->bLocked = false; }
41    bool isLocked() const { return this->bLocked; }
42
43
44    virtual void tick (float time);
45
46
47  private:
48    void init();
49    bool checkOpen();
50    void setAnimation(int animNum, int playbackMode = 0);
51
52
53  private:
54    bool           destroyed;         //!< true if the door is destroyed
55    bool           bOpen;             //!< true if the door is open
56    bool           bLocked;           //!< true if this door is locked
57    float          actionRadius;      //!< action radius
58    float          scale;             //!< the scale of the model
59
60    static sAnim   animationList[3];  //!< list of the animations
61
62    bool           bDead;
63
64
65};
66
67#endif /* _GATE_H */
Note: See TracBrowser for help on using the repository browser.