Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 19, 2007, 9:03:23 AM (17 years ago)
Author:
nicolasc
Message:

added a pulsing capability for the billboard ( I need it for the Plasma Projectile)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/world_entities/effects/billboard.cc

    r10618 r10633  
    6969
    7070  this->texColor = NULL;
     71
     72  this->pulseMagnitude = .5;
     73  this->bPulse = false;
     74
     75  this->angularSpeed = M_PI; //180;
     76  this->angle = 0;
     77
     78  this->setUpdateFunction((*sinf));
    7179}
    7280
     
    113121void Billboard::tick(float dt)
    114122{
     123  this->angle += dt * this->angularSpeed;
     124  if (this->angle > 2 * M_PI)
     125    this->angle -= 2 * M_PI;
    115126}
    116127
     
    145156  v.normalize();
    146157
    147   v *= sizeX;
    148   h *= sizeY;
     158  float tmp = 1;
     159  if (this->bPulse)
     160    tmp = 1 + this->pulseMagnitude * updatePulse(this->angle);
     161
     162  v *= sizeX * tmp;
     163  h *= sizeY * tmp;
    149164
    150165//v += this->getAbsCoor();
Note: See TracChangeset for help on using the changeset viewer.