[Orxonox-commit 5961] r10620 - code/branches/presentationFS15merge/src/orxonox/controllers

landauf at orxonox.net landauf at orxonox.net
Sun Oct 4 15:18:13 CEST 2015


Author: landauf
Date: 2015-10-04 15:18:10 +0200 (Sun, 04 Oct 2015)
New Revision: 10620

Modified:
   code/branches/presentationFS15merge/src/orxonox/controllers/ScriptController.cc
Log:
use our internal definition of pi

Modified: code/branches/presentationFS15merge/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/presentationFS15merge/src/orxonox/controllers/ScriptController.cc	2015-10-04 12:30:26 UTC (rev 10619)
+++ code/branches/presentationFS15merge/src/orxonox/controllers/ScriptController.cc	2015-10-04 13:18:10 UTC (rev 10620)
@@ -46,9 +46,8 @@
 #include "worldentities/ControllableEntity.h"
 #include "core/LuaState.h"
 #include "core/LuaState.h"
-#include <cmath>
+#include "util/Math.h"
 
-
 namespace orxonox
 {
     RegisterClass(ScriptController);
@@ -215,11 +214,11 @@
 
             Vector3* ortho1 = new Vector3(direction.y, -direction.x, 0);
             float absOrtho1 = sqrt(direction.y * direction.y + direction.x * direction.x);
-            *ortho1 = 400 * cos(2 * M_PI * dl) * (*ortho1)/absOrtho1;
+            *ortho1 = 400 * cos(2 * math::pi * dl) * (*ortho1)/absOrtho1;
 
             Vector3* ortho2 = new Vector3(0, direction.z, -direction.y);
             float absOrtho2 = sqrt(direction.y * direction.y + direction.z * direction.z);
-            *ortho2 = 400 * sin(2 * M_PI * dl) * (*ortho2)/absOrtho2;
+            *ortho2 = 400 * sin(2 * math::pi * dl) * (*ortho2)/absOrtho2;
 
             this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1 + *ortho1 + *ortho2);
 
@@ -234,19 +233,19 @@
             Vector3* a;
               switch ((int) currentEvent.d) {
                 case 3:
-                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*M_PI*dl),
-                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*M_PI*dl),
+                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
+                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
                                   this->currentEvent.v1.z);
                 break;
                 case 2:
-                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*M_PI*dl),
+                  a = new Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
                                   this->currentEvent.v1.y,
-                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*M_PI*dl));
+                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
                 break;
                 case 1:
                   a = new Vector3(this->currentEvent.v1.x,
-                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*M_PI*dl),
-                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*M_PI*dl));
+                                  this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
+                                  this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
                 break;
               }
 




More information about the Orxonox-commit mailing list