Changeset 8351 for code/trunk/src/orxonox/graphics
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (14 years ago)
- Location:
- code/trunk/src/orxonox/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/graphics/BlinkingBillboard.cc
r7163 r8351 79 79 if (this->isActive()) 80 80 { 81 this->time_ += dt; 81 // Wrap around to avoid loosing floating point precision 82 this->time_ = std::fmod(this->time_ + dt, 1.0f / this->frequency_); 83 float value = sin((math::twoPi * this->time_ + this->phase_.valueRadians()) * this->frequency_); 82 84 if (this->bQuadratic_) 83 this->setScale(this->amplitude_ * s tatic_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));85 this->setScale(this->amplitude_ * square(value)); 84 86 else 85 this->setScale(this->amplitude_ * st atic_cast<float>(fabs(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));87 this->setScale(this->amplitude_ * std::abs(value)); 86 88 } 87 89 } -
code/trunk/src/orxonox/graphics/BlinkingBillboard.h
r7163 r8351 75 75 Degree phase_; 76 76 bool bQuadratic_; 77 long doubletime_;77 float time_; 78 78 }; 79 79 }
Note: See TracChangeset
for help on using the changeset viewer.