Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 2:36:54 PM (19 years ago)
Author:
bensch
Message:

new_class_id: many more classes done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/effects/lightning_effect.h

    r9006 r9686  
    1717class Light;
    1818
    19 class LightningEffect : public WeatherEffect {
     19class LightningEffect : public WeatherEffect
     20{
     21  NewObjectListDeclaration(LightningEffect);
    2022public:
    21     LightningEffect(const TiXmlElement* root = NULL);
    22     virtual ~LightningEffect();
     23  LightningEffect(const TiXmlElement* root = NULL);
     24  virtual ~LightningEffect();
    2325
    24     virtual void loadParams(const TiXmlElement* root);
     26  virtual void loadParams(const TiXmlElement* root);
    2527
    26     virtual void init();
     28  virtual void init();
    2729
    28     virtual void activate();
    29     virtual void deactivate();
     30  virtual void activate();
     31  virtual void deactivate();
    3032
    31     inline  void activateLightning() {
    32         this->activate();
    33     }
    34     inline  void deactivateLightning() {
    35         this->deactivate();
    36     }
     33  inline  void activateLightning()
     34  {
     35    this->activate();
     36  }
     37  inline  void deactivateLightning()
     38  {
     39    this->deactivate();
     40  }
    3741
    38     virtual void tick(float dt);
     42  virtual void tick(float dt);
    3943
    40     void coord(float x, float y, float z);
    41     void setFlashSize(float width, float height, float seedWidth, float seedHeight);
     44  void coord(float x, float y, float z);
     45  void setFlashSize(float width, float height, float seedWidth, float seedHeight);
    4246
    43     inline void setLightningOption(const std::string& option) {
    44         if (option == "activate")
    45             this->lightningActivate = true;
    46         if (option == "movelightning")
    47             this->lightningMove = true;
    48     }
     47  inline void setLightningOption(const std::string& option)
     48  {
     49    if (option == "activate")
     50      this->lightningActivate = true;
     51    if (option == "movelightning")
     52      this->lightningMove = true;
     53  }
    4954
    50     inline void setFlashFrequency(float baseFrequency, float seedTime) {
    51         this->flashFrequencyBase = baseFrequency;
    52         this->flashFrequency = baseFrequency;
    53         this->flashFrequencySeed = seedTime;
    54     }
     55  inline void setFlashFrequency(float baseFrequency, float seedTime)
     56  {
     57    this->flashFrequencyBase = baseFrequency;
     58    this->flashFrequency = baseFrequency;
     59    this->flashFrequencySeed = seedTime;
     60  }
    5561
    56     inline void setFlashConstTime(float holdTime) {
    57         this->flashHoldTime = holdTime;
    58     }
     62  inline void setFlashConstTime(float holdTime)
     63  {
     64    this->flashHoldTime = holdTime;
     65  }
    5966
    60     inline void setFlashRisingTime(float flashRisingTime) {
    61         if(flashRisingTime > this->flashHoldTime)
    62             this->flashRisingTime = this->flashHoldTime * 0.5;
    63         else
    64             this->flashRisingTime = flashRisingTime;
    65     }
     67  inline void setFlashRisingTime(float flashRisingTime)
     68  {
     69    if(flashRisingTime > this->flashHoldTime)
     70      this->flashRisingTime = this->flashHoldTime * 0.5;
     71    else
     72      this->flashRisingTime = flashRisingTime;
     73  }
    6674
    67     inline void setFlashSeed(float seedX, float seedZ) {
    68         this->seedX = seedX;
    69         this->seedZ = seedZ;
    70     }
     75  inline void setFlashSeed(float seedX, float seedZ)
     76  {
     77    this->seedX = seedX;
     78    this->seedZ = seedZ;
     79  }
    7180
    7281
    7382private:
    7483
    75     void newCoordinates();
    76     void setTexture();
    77     void switchTexture();
     84  void newCoordinates();
     85  void setTexture();
     86  void switchTexture();
    7887
    79     Billboard* thunderBolt[4];
    80     bool thunderTextureA;
     88  Billboard* thunderBolt[4];
     89  bool thunderTextureA;
    8190
    82     bool lightningActivate;
    83     bool lightningMove;
     91  bool lightningActivate;
     92  bool lightningMove;
    8493
    85     float flashFrequency;
    86     float flashFrequencyBase;
    87     float flashHoldTime;
    88     float flashRisingTime;
     94  float flashFrequency;
     95  float flashFrequencyBase;
     96  float flashHoldTime;
     97  float flashRisingTime;
    8998
    90     float time;
     99  float time;
    91100
    92     float width;
    93     float height;
    94     float seedWidth;
    95     float seedHeight;
     101  float width;
     102  float height;
     103  float seedWidth;
     104  float seedHeight;
    96105
    97     float seedX;
    98     float seedZ;
    99     float flashFrequencySeed;
     106  float seedX;
     107  float seedZ;
     108  float flashFrequencySeed;
    100109
    101     float mainPosX;
    102     float mainPosY;
    103     float mainPosZ;
     110  float mainPosX;
     111  float mainPosY;
     112  float mainPosZ;
    104113
    105     Vector origSkyColor;
    106     Vector cameraCoor;
     114  Vector origSkyColor;
     115  Vector cameraCoor;
    107116
    108     Light* flashLight;
     117  Light* flashLight;
    109118
    110     OrxSound::SoundSource    soundSource;
    111     OrxSound::SoundBuffer*   thunderBuffer;
     119  OrxSound::SoundSource    soundSource;
     120  OrxSound::SoundBuffer*   thunderBuffer;
    112121
    113122};
Note: See TracChangeset for help on using the changeset viewer.