Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/single_player_map/src/world_entities/door.h @ 8880

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

door animation even nicer implemented

File size: 1.1 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  OPEN = 0,
15  CLOSE,
16
17  MAX_ANIMATIONS
18};
19
20
21class Door : public WorldEntity
22{
23  public:
24    Door ();
25    Door(const TiXmlElement* root);
26    virtual ~Door ();
27
28    void init();
29    virtual void loadParams(const TiXmlElement* root);
30
31    void setActionRadius(float radius) { this->actionRadius = radius; }
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
54    static sAnim   animationList[2];  //!< list of the animations
55
56};
57
58#endif /* _DOOR_H */
Note: See TracBrowser for help on using the repository browser.