- Timestamp:
- Dec 5, 2016, 3:59:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc
r11309 r11318 17 17 RegisterObject(WaypointGroup); 18 18 activeWaypoint = nullptr; 19 current = 0; 19 20 20 21 //model = new Model(this->getContext()); … … 25 26 //model->setPosition(Vector3(0.0,0.0,0.0)); // this is wrong, it has to be triggered 26 27 //waypoint_active = false; 27 //distancetrigger = new DistanceTrigger(this->getContext()); 28 //distancetrigger = new DistanceTrigger(this->getContext()); 28 29 //distancetrigger->setDistance(100); 29 30 //this->attach(distancetrigger); 30 31 31 32 } 32 33 … … 40 41 //setOrientation() 41 42 42 43 43 44 44 45 … … 57 58 void WaypointGroup::setWaypoint(Waypoint* object) 58 59 { 60 object->setWaypointGroup(this); 59 61 this->waypoints_.insert(object); 60 62 } 61 63 64 void WaypointGroup::activateNext(){ 65 if (std::next(waypoints_.begin(), current) != std::next(waypoints_.end(), 0)){ 66 activeWaypoint = *std::next(waypoints_.begin(), current); 67 ++current; 68 } 69 } 62 70 63 71 Waypoint* WaypointGroup::getActive(){ 64 72 if (activeWaypoint == nullptr){ 65 73 orxout() << "Null Pointer" << endl; 66 activ ateNext();74 activeWaypoint = getFirst(); 67 75 68 } 69 //else if (activeWaypoint->) 76 } 70 77 return activeWaypoint; 71 78 } 72 79 73 Waypoint* WaypointGroup::activateNext(){ 74 for (Waypoint* object : this->waypoints_){ 75 if(!(object->waypoint_actived)){ 76 object->enable_waypoint(); 77 activeWaypoint = object; 78 break; 79 } 80 } 81 return activeWaypoint; 80 // Waypoint* WaypointGroup::activateNext(){ 81 // for (Waypoint* object : this->waypoints_){ 82 // if(!(object->waypoint_actived)){ 83 // //object->enable_waypoint(); 84 // activeWaypoint = object; 85 // break; 86 // } 87 // } 88 // return activeWaypoint; 89 // } 90 91 Waypoint* WaypointGroup::getFirst(){ 92 std::set<Waypoint*>::iterator it = waypoints_.begin(); 93 return *it; 82 94 } 83 95 84 96 85 86 97 87 98 void WaypointGroup::XMLPort(Element& xmlelement, XMLPort::Mode mode){
Note: See TracChangeset
for help on using the changeset viewer.