Changeset 10633 in orxonox.OLD for branches/vs-enhencements
- Timestamp:
- Apr 19, 2007, 9:03:23 AM (18 years ago)
- Location:
- branches/vs-enhencements/src/world_entities/effects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/world_entities/effects/billboard.cc
r10618 r10633 69 69 70 70 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)); 71 79 } 72 80 … … 113 121 void Billboard::tick(float dt) 114 122 { 123 this->angle += dt * this->angularSpeed; 124 if (this->angle > 2 * M_PI) 125 this->angle -= 2 * M_PI; 115 126 } 116 127 … … 145 156 v.normalize(); 146 157 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; 149 164 150 165 //v += this->getAbsCoor(); -
branches/vs-enhencements/src/world_entities/effects/billboard.h
r10433 r10633 26 26 void colorTexture(const Color col); 27 27 28 inline void togglePluse () {this->bPulse = !bPulse; }; 29 inline void setPulse () { this->bPulse = true; }; 30 inline void setPulse ( bool state ) {this->bPulse = state; }; 31 inline float getPulse () { return this->bPulse; }; 32 28 33 virtual void tick(float dt); 29 34 virtual void draw() const; 30 35 36 inline void setUpdateFunction(float (*updateFct)(float value)) { if( updateFct) this->updatePulse = updateFct;}; 37 31 38 private: 39 40 float (*updatePulse)(float value); 41 32 42 Material* material; 33 43 Color* texColor; 34 44 float sizeX; 35 45 float sizeY; 46 47 bool bPulse; 48 float pulseMagnitude; 49 float angle; 50 float angularSpeed; 36 51 }; 37 52 -
branches/vs-enhencements/src/world_entities/effects/wobblegrid.cc
r10618 r10633 10 10 11 11 ### File Specific: 12 main-programmer: David Hasenfratz12 main-programmer: Marc Schärer 13 13 */ 14 14
Note: See TracChangeset
for help on using the changeset viewer.