Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/door.h @ 8914

Last change on this file since 8914 was 8894, checked in by patrick, 18 years ago

merged the branche single_player_map with the trunk

File size: 1.2 KB
Line 
1#ifndef _DOOR_H
2#define _DOOR_H
3
4#include "world_entity.h"
5
6#include "md2/md2Model.h"
7
8class TiXmlElement;
9
10
11//! animation names enumeration
12typedef enum DoorAnimType
13{
14  DOOR_OPEN = 0,
15  DOOR_CLOSE,
16
17  DOOR_MAX_ANIMATIONS
18};
19
20
21class Door : public WorldEntity
22{
23  public:
24    Door ();
25    Door(const TiXmlElement* root);
26    virtual ~Door ();
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
36    void lock() { this->bLocked = true; }
37    void unlock() { this->bLocked = false; }
38    bool isLocked() const { return this->bLocked; }
39
40
41    virtual void tick (float time);
42
43
44  private:
45    bool checkOpen();
46    void setAnimation(int animNum, int playbackMode = 0);
47
48
49  private:
50    bool           bOpen;             //!< true if the door is open
51    bool           bLocked;           //!< true if this door is locked
52    float          actionRadius;      //!< action radius
53    float          scale;             //!< the scale of the model
54
55    static sAnim   animationList[2];  //!< list of the animations
56
57
58};
59
60#endif /* _DOOR_H */
Note: See TracBrowser for help on using the repository browser.