Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 3:18:10 PM (9 years ago)
Author:
landauf
Message:

use our internal definition of pi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS15merge/src/orxonox/controllers/ScriptController.cc

    r10614 r10620  
    4747#include "core/LuaState.h"
    4848#include "core/LuaState.h"
    49 #include <cmath>
    50 
     49#include "util/Math.h"
    5150
    5251namespace orxonox
     
    216215            Vector3* ortho1 = new Vector3(direction.y, -direction.x, 0);
    217216            float absOrtho1 = sqrt(direction.y * direction.y + direction.x * direction.x);
    218             *ortho1 = 400 * cos(2 * M_PI * dl) * (*ortho1)/absOrtho1;
     217            *ortho1 = 400 * cos(2 * math::pi * dl) * (*ortho1)/absOrtho1;
    219218
    220219            Vector3* ortho2 = new Vector3(0, direction.z, -direction.y);
    221220            float absOrtho2 = sqrt(direction.y * direction.y + direction.z * direction.z);
    222             *ortho2 = 400 * sin(2 * M_PI * dl) * (*ortho2)/absOrtho2;
     221            *ortho2 = 400 * sin(2 * math::pi * dl) * (*ortho2)/absOrtho2;
    223222
    224223            this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1 + *ortho1 + *ortho2);
     
    235234              switch ((int) currentEvent.d) {
    236235                case 3:
    237                   a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*M_PI*dl),
    238                                   this->currentEvent.v1.y + this->currentEvent.e*sin(2*M_PI*dl),
     236                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
     237                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
    239238                                  this->currentEvent.v1.z);
    240239                break;
    241240                case 2:
    242                   a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*M_PI*dl),
     241                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
    243242                                  this->currentEvent.v1.y,
    244                                   this->currentEvent.v1.z + this->currentEvent.e*cos(2*M_PI*dl));
     243                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
    245244                break;
    246245                case 1:
    247246                  a = new Vector3(this->currentEvent.v1.x,
    248                                   this->currentEvent.v1.y + this->currentEvent.e*sin(2*M_PI*dl),
    249                                   this->currentEvent.v1.z + this->currentEvent.e*cos(2*M_PI*dl));
     247                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
     248                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
    250249                break;
    251250              }
Note: See TracChangeset for help on using the changeset viewer.