[Orxonox-commit 6679] r11309 - code/branches/QuestGuide_HS16/src/modules/waypoints

ooguz at orxonox.net ooguz at orxonox.net
Mon Nov 28 16:04:45 CET 2016


Author: ooguz
Date: 2016-11-28 16:04:45 +0100 (Mon, 28 Nov 2016)
New Revision: 11309

Modified:
   code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.cc
   code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc
   code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc
Log:
Distance Trigger base methods

Modified: code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.cc
===================================================================
--- code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.cc	2016-11-28 15:00:23 UTC (rev 11308)
+++ code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.cc	2016-11-28 15:04:45 UTC (rev 11309)
@@ -25,6 +25,9 @@
         waypoint_actived = false;
         distancetrigger = new DistanceTrigger(this->getContext());   
         distancetrigger->setDistance(100);
+        distanceTrigger_->addTarget("Pawn");
+         this->addEventSource(distanceTrigger_, "explode");
+
         this->attach(distancetrigger);
     }
 

Modified: code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc
===================================================================
--- code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc	2016-11-28 15:00:23 UTC (rev 11308)
+++ code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc	2016-11-28 15:04:45 UTC (rev 11309)
@@ -62,11 +62,11 @@
 
     Waypoint* WaypointGroup::getActive(){
           if (activeWaypoint == nullptr){
-                                    orxout() << "OOOOOOOOOO" << endl;
-
+            orxout() << "Null Pointer" << endl;
             activateNext();
 
-          }            
+          } 
+          //else if (activeWaypoint->)           
           return activeWaypoint;
     }
 
@@ -75,6 +75,7 @@
             if(!(object->waypoint_actived)){
                 object->enable_waypoint();
                 activeWaypoint = object;
+                break;
             }
         }
         return activeWaypoint;

Modified: code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc
===================================================================
--- code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc	2016-11-28 15:00:23 UTC (rev 11308)
+++ code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc	2016-11-28 15:04:45 UTC (rev 11309)
@@ -60,7 +60,7 @@
     void Waypointarrow::tick(float dt){
 
         if (getWaypointgroup() == nullptr){
-                    orxout() << "Second" << endl;
+                  orxout() << "Second" << endl;
 
             return;
         }
@@ -71,14 +71,14 @@
 
         Vector3 waypoint_position = waypoint->getWorldPosition();
 
-        Vector3 trial = waypoint_position - this->getWorldPosition();
 
         //orxout() << "dsfsf" << waypoint_position.x << endl;
-        orxout() << "waypoint " << waypoint_position.x <<  "waypoint " << waypoint_position.y << "waypoint " << waypoint_position.z << endl;
-        orxout() << "model " << this->model->getWorldPosition().x <<  "model " << this->model->getWorldPosition().y << "model " << this->model->getWorldPosition().z << endl;
-        orxout() << "this " << this->getWorldPosition().x <<  "this " << this->getWorldPosition().y << "this " << this->getWorldPosition().z << endl;
-        orxout() << "trial " << trial.x <<  "trial " << trial.y << "trial " << trial.z << endl;
+    //    orxout() << "waypoint " << waypoint_position.x <<  "waypoint " << waypoint_position.y << "waypoint " << waypoint_position.z << endl;
+      //  orxout() << "model " << this->model->getWorldPosition().x <<  "model " << this->model->getWorldPosition().y << "model " << this->model->getWorldPosition().z << endl;
+      //  orxout() << "this " << this->getWorldPosition().x <<  "this " << this->getWorldPosition().y << "this " << this->getWorldPosition().z << endl;
+       // orxout() << "trial " << trial.x <<  "trial " << trial.y << "trial " << trial.z << endl;
 
+
         Vector3 origin = model->getWorldPosition();;
         model->setDirection( origin - waypoint_position, TransformSpace::World);
      




More information about the Orxonox-commit mailing list