Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

door and weapon stuff

File size: 1.2 KB
RevLine 
[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]8class TiXmlElement;
9
[8872]10
[8880]11//! animation names enumeration
12typedef enum DoorAnimType
13{
[8881]14  DOOR_OPEN = 0,
15  DOOR_CLOSE,
[8880]16
[8881]17  DOOR_MAX_ANIMATIONS
[8880]18};
19
20
[8872]21class Door : public WorldEntity
[8870]22{
[8872]23  public:
24    Door ();
25    Door(const TiXmlElement* root);
26    virtual ~Door ();
[8870]27
[8872]28    virtual void loadParams(const TiXmlElement* root);
[8870]29
[8875]30    void setActionRadius(float radius) { this->actionRadius = radius; }
[8890]31    void setScale(float scale) { this->scale = scale; }
[8870]32
[8875]33    void open();
34    void close();
35
[8876]36    void lock() { this->bLocked = true; }
37    void unlock() { this->bLocked = false; }
38    bool isLocked() const { return this->bLocked; }
39
40
[8880]41    virtual void tick (float time);
42
43
[8872]44  private:
[8874]45    bool checkOpen();
[8880]46    void setAnimation(int animNum, int playbackMode = 0);
[8870]47
[8876]48
[8872]49  private:
50    bool           bOpen;             //!< true if the door is open
[8876]51    bool           bLocked;           //!< true if this door is locked
[8875]52    float          actionRadius;      //!< action radius
[8890]53    float          scale;             //!< the scale of the model
[8870]54
[8880]55    static sAnim   animationList[2];  //!< list of the animations
[8876]56
[8890]57
[8870]58};
59
[8872]60#endif /* _DOOR_H */
Note: See TracBrowser for help on using the repository browser.