Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10698 in orxonox.OLD for trunk/src/world_entities/effects


Ignore:
Timestamp:
Jun 14, 2007, 5:33:43 PM (17 years ago)
Author:
snellen
Message:

merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!

Location:
trunk/src/world_entities/effects
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/effects/billboard.cc

    r10618 r10698  
    1111### File Specific:
    1212   main-programmer: David Hasenfratz
     13   co-programmer: Nicolas Schlumberger
    1314*/
    1415
     
    6970
    7071  this->texColor = NULL;
     72
     73  this->pulseMagnitude = .5;
     74  this->bPulse = false;
     75
     76  this->angularSpeed = M_2_PI; //360;
     77  this->angle = 0;
     78
     79  this->setUpdateFunction((*sinf));
    7180}
    7281
     
    113122void Billboard::tick(float dt)
    114123{
     124  this->angle += dt * this->angularSpeed;
     125  if (this->angle > M_2_PI)
     126    this->angle -= M_2_PI;
     127//   curMagnitude = updatePulse(this->angle);
    115128}
    116129
     
    145158  v.normalize();
    146159
    147   v *= sizeX;
    148   h *= sizeY;
     160  float tmp = 1;
     161  if (this->bPulse)
     162    tmp += this->pulseMagnitude * sinf(this->angle); //updatePulse(this->angle);
     163
     164  v *= sizeX * tmp;
     165  h *= sizeY * tmp;
    149166
    150167//v += this->getAbsCoor();
  • trunk/src/world_entities/effects/billboard.h

    r10433 r10698  
    2626    void colorTexture(const Color col);
    2727
     28    //!< Pulsing Capability, changes size of the grid
     29    inline void togglePluse () {this->bPulse = !bPulse; };
     30    inline void setPulse () { this->bPulse = true; };
     31    inline void setPulse ( bool state ) {this->bPulse = state; };
     32    inline float getPulse () { return this->bPulse; };
     33
     34    inline void setPulseMagnitude(float mag) {this->pulseMagnitude = mag; };
     35
    2836    virtual void tick(float dt);
    2937    virtual void draw() const;
    3038
     39    inline void setUpdateFunction(float (*updateFct)(float value)) { if( updateFct)  this->updatePulse = updateFct;};
     40
    3141  private:
     42
     43    float (*updatePulse)(float value);
     44
    3245    Material*        material;
    3346    Color*           texColor;
    3447    float sizeX;
    3548    float sizeY;
     49
     50    bool bPulse;
     51    float pulseMagnitude;
     52    float curMagnitude;
     53    float angle;
     54    float angularSpeed;
    3655};
    3756
  • trunk/src/world_entities/effects/blink.cc

    r10618 r10698  
    6767  this->bBoard->setTexture("textures/light/blink.png");
    6868
    69   /// Standard values
     69  //!< Standard values
    7070  this->bBoard->setAbsCoor(0, 0, 0);
    7171  // default position if not set in xml
  • trunk/src/world_entities/effects/explosion.h

    r10695 r10698  
    3232    virtual void tick (float time);
    3333
    34   private:
     34    void setLifeTime( float lifeTime ){ this->lifeTime = lifeTime; }
     35
     36  protected:
    3537    static FastFactory*        fastFactory;
    3638
  • trunk/src/world_entities/effects/wobblegrid.cc

    r10618 r10698  
    1010
    1111### File Specific:
    12    main-programmer: David Hasenfratz
     12   main-programmer: Marc Schärer
    1313*/
    1414
Note: See TracChangeset for help on using the changeset viewer.