source:
orxonox.OLD/trunk/src/world_entities/npcs/door.h
@
10365
Last change on this file since 10365 was 9869, checked in by bensch, 18 years ago | |
---|---|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[8872] | 1 | #ifndef _DOOR_H |
2 | #define _DOOR_H | |
[8870] | 3 | |
4 | #include "world_entity.h" | |
5 | ||
[8880] | 6 | #include "md2/md2Model.h" |
[8872] | 7 | |
[8870] | 8 | class TiXmlElement; |
9 | ||
[8872] | 10 | |
[8880] | 11 | //! animation names enumeration |
12 | typedef enum DoorAnimType | |
13 | { | |
[8881] | 14 | DOOR_OPEN = 0, |
15 | DOOR_CLOSE, | |
[8880] | 16 | |
[8881] | 17 | DOOR_MAX_ANIMATIONS |
[8880] | 18 | }; |
19 | ||
20 | ||
[8872] | 21 | class Door : public WorldEntity |
[8870] | 22 | { |
[9869] | 23 | ObjectListDeclaration(Door); |
24 | ||
[8872] | 25 | public: |
[9110] | 26 | Door(const TiXmlElement* root = NULL); |
[8872] | 27 | virtual ~Door (); |
[8870] | 28 | |
[8872] | 29 | virtual void loadParams(const TiXmlElement* root); |
[8870] | 30 | |
[8875] | 31 | void setActionRadius(float radius) { this->actionRadius = radius; } |
[8890] | 32 | void setScale(float scale) { this->scale = scale; } |
[8870] | 33 | |
[8875] | 34 | void open(); |
35 | void close(); | |
36 | ||
[8876] | 37 | void lock() { this->bLocked = true; } |
38 | void unlock() { this->bLocked = false; } | |
39 | bool isLocked() const { return this->bLocked; } | |
40 | ||
41 | ||
[8880] | 42 | virtual void tick (float time); |
43 | ||
44 | ||
[8872] | 45 | private: |
[9110] | 46 | void init(); |
[8874] | 47 | bool checkOpen(); |
[8880] | 48 | void setAnimation(int animNum, int playbackMode = 0); |
[8870] | 49 | |
[8876] | 50 | |
[8872] | 51 | private: |
52 | bool bOpen; //!< true if the door is open | |
[8876] | 53 | bool bLocked; //!< true if this door is locked |
[8875] | 54 | float actionRadius; //!< action radius |
[8890] | 55 | float scale; //!< the scale of the model |
[8870] | 56 | |
[8880] | 57 | static sAnim animationList[2]; //!< list of the animations |
[8876] | 58 | |
[8890] | 59 | |
[8870] | 60 | }; |
61 | ||
[8872] | 62 | #endif /* _DOOR_H */ |
Note: See TracBrowser
for help on using the repository browser.