Last change
on this file since 9929 was
9110,
checked in by bensch, 18 years ago
|
orxonox/trunk: merged the Presentation back
|
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 | |
---|
8 | class TiXmlElement; |
---|
9 | |
---|
10 | |
---|
11 | //! animation names enumeration |
---|
12 | typedef enum DoorAnimType |
---|
13 | { |
---|
14 | DOOR_OPEN = 0, |
---|
15 | DOOR_CLOSE, |
---|
16 | |
---|
17 | DOOR_MAX_ANIMATIONS |
---|
18 | }; |
---|
19 | |
---|
20 | |
---|
21 | class Door : public WorldEntity |
---|
22 | { |
---|
23 | public: |
---|
24 | Door(const TiXmlElement* root = NULL); |
---|
25 | virtual ~Door (); |
---|
26 | |
---|
27 | virtual void loadParams(const TiXmlElement* root); |
---|
28 | |
---|
29 | void setActionRadius(float radius) { this->actionRadius = radius; } |
---|
30 | void setScale(float scale) { this->scale = scale; } |
---|
31 | |
---|
32 | void open(); |
---|
33 | void close(); |
---|
34 | |
---|
35 | void lock() { this->bLocked = true; } |
---|
36 | void unlock() { this->bLocked = false; } |
---|
37 | bool isLocked() const { return this->bLocked; } |
---|
38 | |
---|
39 | |
---|
40 | virtual void tick (float time); |
---|
41 | |
---|
42 | |
---|
43 | private: |
---|
44 | void init(); |
---|
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.