| [10175] | 1 | /*! | 
|---|
 | 2 |  * @file blink.h | 
|---|
 | 3 |  */ | 
|---|
| [10445] | 4 |  /*! example input in .oxw file with the standard values | 
|---|
| [10175] | 5 |  | 
|---|
| [10445] | 6 | <Blink> | 
|---|
 | 7 |   <name>Blink1</name> | 
|---|
 | 8 |   <position>580, 70, -130</position> | 
|---|
 | 9 |   <color>0, 255, 255</color> | 
|---|
 | 10 |   <size>8</size> | 
|---|
 | 11 |   <period>9</period> | 
|---|
 | 12 |   <sequence>0123456789</sequence><!-- the number describe the strength of the blink light --> | 
|---|
 | 13 | </Blink> | 
|---|
 | 14 |  | 
|---|
 | 15 | */ | 
|---|
 | 16 |  | 
|---|
| [10175] | 17 | #ifndef _BLINK_H | 
|---|
 | 18 | #define _BLINK_H | 
|---|
 | 19 |  | 
|---|
 | 20 | #include "world_entity.h" | 
|---|
| [10407] | 21 | #include "effects/billboard.h" | 
|---|
| [10425] | 22 | #include "color.h" | 
|---|
| [10175] | 23 |  | 
|---|
 | 24 | class Material; | 
|---|
 | 25 | class TiXmlElement; | 
|---|
| [10407] | 26 | //class Billboard; | 
|---|
| [10175] | 27 |  | 
|---|
 | 28 | class Blink : public WorldEntity | 
|---|
 | 29 | { | 
|---|
 | 30 |   ObjectListDeclaration(Blink); | 
|---|
 | 31 |   public: | 
|---|
 | 32 |     Blink(const TiXmlElement* root = NULL); | 
|---|
 | 33 |     virtual ~Blink(); | 
|---|
 | 34 |  | 
|---|
 | 35 |     void init(); | 
|---|
 | 36 |     void loadParams(const TiXmlElement* root); | 
|---|
 | 37 |  | 
|---|
| [10429] | 38 |     void setPosition(float x, float y, float z) { this->bBoard->setAbsCoor(x, y, z); } | 
|---|
| [10407] | 39 |     void setSize(float s) { this->size = s; this->bBoard->setSize(this->size, this->size); } | 
|---|
| [10445] | 40 |     void setPeriod(float t) { this->period = t; } | 
|---|
| [10425] | 41 |     void setColor(float r, float g, float b) { this->color = Color(r/255, g/255, b/255); } | 
|---|
| [10445] | 42 |     void loadBlinkSequence(const std::string& seq) { this->blinkSequence = seq; } | 
|---|
| [10175] | 43 |  | 
|---|
 | 44 |     virtual void tick(float dt); | 
|---|
 | 45 |     virtual void draw() const; | 
|---|
 | 46 |  | 
|---|
 | 47 |   private: | 
|---|
| [10407] | 48 |     Billboard*        bBoard; | 
|---|
| [10425] | 49 |     Color             color; | 
|---|
| [10445] | 50 |     std::string       blinkSequence;    //! 1 means fully viewable, 0 means fully transparent | 
|---|
| [10325] | 51 |     float             angle; | 
|---|
| [10445] | 52 |     float             period;           //! period in seconds | 
|---|
| [10325] | 53 |     float             blinkStr; | 
|---|
| [10253] | 54 |     float             size;             //! only one float caus' its quadratical | 
|---|
| [10445] | 55 |     int               seqCounter; | 
|---|
 | 56 |     float             symbolTime;       //! defines how long one symbol of the sequence will be shown in sec | 
|---|
 | 57 |     float             timer; | 
|---|
| [10175] | 58 | }; | 
|---|
 | 59 |  | 
|---|
 | 60 | #endif /* _BLINK_H */ | 
|---|