Changeset 8333 for code/branches/kicklib2/src/orxonox
- Timestamp:
- Apr 26, 2011, 4:46:26 AM (14 years ago)
- Location:
- code/branches/kicklib2/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2/src/orxonox/controllers/ArtificialController.cc
r7801 r8333 847 847 Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition(); 848 848 Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition(); 849 if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * math::pi))850 < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * math::pi)) + rnd(-250, 250))849 if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi) 850 < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250)) 851 851 { 852 852 this->target_ = (*it); -
code/branches/kicklib2/src/orxonox/controllers/NewHumanController.cc
r7859 r8333 543 543 if (distance > 0.04f && distance <= 0.59f * arrowsSize_ / 2.0f ) 544 544 { 545 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));545 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 546 546 this->arrowsOverlay1_->show(); 547 547 } 548 548 else if (distance > 0.59f * arrowsSize_ / 2.0f && distance <= 0.77f * arrowsSize_ / 2.0f ) 549 549 { 550 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));550 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 551 551 this->arrowsOverlay2_->show(); 552 552 } 553 553 else if (distance > 0.77f * arrowsSize_ / 2.0f && distance <= arrowsSize_ / 2.0f) 554 554 { 555 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));555 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 556 556 this->arrowsOverlay3_->show(); 557 557 } 558 558 else if (distance > arrowsSize_ / 2.0f) 559 559 { 560 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));560 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 561 561 this->arrowsOverlay4_->show(); 562 562 } -
code/branches/kicklib2/src/orxonox/graphics/BlinkingBillboard.cc
r8332 r8333 81 81 // Wrap around to avoid loosing floating point precision 82 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_);83 float value = sin((math::twoPi * this->time_ + this->phase_.valueRadians()) * this->frequency_); 84 84 if (this->bQuadratic_) 85 85 this->setScale(this->amplitude_ * square(value)); -
code/branches/kicklib2/src/orxonox/overlays/OrxonoxOverlay.cc
r7401 r8333 283 283 angle = -angle; 284 284 angle -= math::pi * static_cast<int>(angle / (math::pi)); 285 if (angle > math::pi * 0.5)285 if (angle > math::pi_2) 286 286 angle = math::pi - angle; 287 287
Note: See TracChangeset
for help on using the changeset viewer.