- Timestamp:
- May 26, 2016, 3:54:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc
r11190 r11204 46 46 #include "scriptTasks/DebugTask.h" 47 47 #include "scriptTasks/stringOutTask.h" 48 #include "scriptTasks/MoveToTask.h" 48 49 #include "scriptTasks/Task.h" 49 50 #include "infos/PlayerInfo.h" … … 102 103 this->setControllableEntity(this->entity_); 103 104 this->entity_->mouseLook(); 104 this->entity_->setVisible( false);105 this->entity_->setVisible(true); 105 106 106 107 // TODO take the human Controllers control dont forget to give it back in the destructor … … 116 117 // If this controller has no entity entry, do nothing 117 118 if( !(this->entity_) ) return; 118 119 120 /*121 if(taskQueue_.front()->getStartTime() <= scTime_)122 {123 activeTasks_.push_back(taskQueue_.front());124 taskQueue_.pop();125 }126 127 for(Task* task : activeTasks_)128 {129 task->tick(dt);130 }*/131 119 132 120 if(!this->taskList_.empty()) … … 211 199 212 200 task->initialize(startTime, output); 201 202 bool inserted = false; 203 204 if(taskList_.empty()) 205 { 206 taskList_.push_front(task); 207 inserted = true; 208 } 209 210 else 211 { 212 for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime 213 { 214 orxout() << "stringOutTask" << endl; 215 216 if(task->getStartTime() < (*it)->getStartTime() ) 217 { 218 taskList_.insert(it, task); 219 inserted = true; 220 break; 221 } 222 } 223 } 224 225 if (!inserted) 226 { 227 taskList_.push_back(task); 228 } 229 230 } 231 232 void NewScriptController::moveTo(float startTime, float x, float y, float z, float velocity) 233 { 234 235 MoveToTask* task = new MoveToTask(context_); 236 237 Vector3 destination = Vector3(x,y,z); 238 239 task->initialize(startTime, player_, destination, velocity); 213 240 214 241 bool inserted = false;
Note: See TracChangeset
for help on using the changeset viewer.