Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2011, 4:46:26 AM (13 years ago)
Author:
rgrieder
Message:

Removed double precision versions of the mathematical constants and added math::twoPi.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2/src/orxonox/controllers/NewHumanController.cc

    r7859 r8333  
    543543            if (distance > 0.04f && distance <= 0.59f * arrowsSize_ / 2.0f )
    544544            {
    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));
    546546                this->arrowsOverlay1_->show();
    547547            }
    548548            else if (distance > 0.59f * arrowsSize_ / 2.0f && distance <= 0.77f * arrowsSize_ / 2.0f )
    549549            {
    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));
    551551                this->arrowsOverlay2_->show();
    552552            }
    553553            else if (distance > 0.77f * arrowsSize_ / 2.0f && distance <= arrowsSize_ / 2.0f)
    554554            {
    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));
    556556                this->arrowsOverlay3_->show();
    557557            }
    558558            else if (distance > arrowsSize_ / 2.0f)
    559559            {
    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));
    561561                this->arrowsOverlay4_->show();
    562562            }
Note: See TracChangeset for help on using the changeset viewer.