Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 18, 2010, 9:46:16 PM (14 years ago)
Author:
rgrieder
Message:

Replaced mathematical constants with a common definition in Math.h.
Use math::pi, math::pi_d (double), math::e, etc. from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc

    r7183 r7184  
    171171
    172172                Radian pitch = this->cameraPositionRootNode_->getOrientation().getPitch();
    173                 if (pitch < Radian(1.5707f) && pitch > Radian(-1.5707f))
     173                if (pitch < Radian(math::pi_2) && pitch > Radian(-math::pi_2))
    174174                {
    175175                    this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
    176176                }
    177                 else if (pitch < Radian(-1.5707f))
     177                else if (pitch < Radian(-math::pi_2))
    178178                {
    179179                    if (this->pitch_ > 0.0f)
    180180                        this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
    181                     else if (pitch < Radian(-1.571f))
    182                         this->cameraPositionRootNode_->pitch(-pitch + Radian(-1.570796f));
     181                    else if (pitch < Radian(-math::pi_2))
     182                        this->cameraPositionRootNode_->pitch(-pitch + Radian(-math::pi_2));
    183183                }
    184                 else if (pitch > Radian(1.5707f))
     184                else if (pitch > Radian(math::pi_2))
    185185                {
    186186                    if (this->pitch_ < 0.0f)
    187187                        this->cameraPositionRootNode_->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
    188                     else if (pitch > Radian(1.571f))
    189                         this->cameraPositionRootNode_->pitch(-pitch + Radian(1.570796f));
     188                    else if (pitch > Radian(math::pi_2))
     189                        this->cameraPositionRootNode_->pitch(-pitch + Radian(math::pi_2));
    190190                }
    191191                this->weaponNode_->setOrientation(this->cameraPositionRootNode_->getOrientation());
Note: See TracChangeset for help on using the changeset viewer.