Changeset 10038 for code/branches/ScriptableController
- Timestamp:
- Apr 17, 2014, 4:04:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc
r10034 r10038 67 67 { 68 68 69 /*const Vector3 local=getPosition();70 const Vector3 * target=newVector3(x,y,z);69 const Vector3 local=getPosition(); 70 const Vector3 target=Vector3(x,y,z); 71 71 72 setDirection(target, TransformSpace relativeTo = WorldEntity::Local, local);72 Vector3 way=target-local; 73 73 74 float dist = (target - local).length(); 74 75 this->controlled->lookAt(target); 75 76 76 moveFrontBack(dist);*/77 this->controlled->moveFrontBack(way.length()); 77 78 78 orxout()<<x<<" "<<y<<" "<<z<<endl; 79 80 /*orxout()<<x<<" "<<y<<" "<<z<<endl;*/ 79 81 80 82 81 83 82 //this->controlled->rotateYaw(-sgn(coord.x)*coord.x*coord.x); erkennt coord nicht 83 //this->controlled->rotatePitch(sgn(coord.y)*coord.y*coord.y); 84 84 85 } 85 86 86 /* TO DO; noetige bewegungsfunktionen mit geschw., verbleibzeit.. als parameter*/ 87 /* TODO: hilfs(zwischen)funktionen um lua eingabe zu ermoeglichen: zb moveToPosition(float...) weil in LUA wohl 88 kein vektor3 definierbar ist 87 89 88 /*void WaypointController::tick(float dt) //copied from waypointcontroller 89 { 90 if (!this->isActive()) 91 return; 90 NB: viele noetige funktionen sind schon in artificial- bzw formationcontroller vorhanden 92 91 93 if (this->waypoints_.size() == 0 || !this->getControllableEntity()) 94 return; 95 96 if (this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_) 97 this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size(); 98 99 this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition()); 100 }*/ 101 102 /* TO DO 103 in the constuctor: make accessible functions such as moveToPosition.. in LUA 104 ->tolua++ example: http://usefulgamedev.weebly.com/tolua-example.html*/ 105 106 107 108 //function to execute the luafile 92 tick funktion?*/ 109 93 110 94
Note: See TracChangeset
for help on using the changeset viewer.