- Timestamp:
- Apr 26, 2011, 2:52:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2/src/orxonox/graphics/BlinkingBillboard.cc
r7163 r8332 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((2.0f * math::pi * 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 }
Note: See TracChangeset
for help on using the changeset viewer.