Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/hud/src/world_entities/npcs/door.h @ 10662

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