[Orxonox-commit 5375] r10038 - code/branches/ScriptableController/src/orxonox/controllers
samuezu at orxonox.net
samuezu at orxonox.net
Thu Apr 17 16:04:50 CEST 2014
Author: samuezu
Date: 2014-04-17 16:04:50 +0200 (Thu, 17 Apr 2014)
New Revision: 10038
Modified:
code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc
Log:
scriptcontroller slightly modified
Modified: code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc 2014-04-17 14:00:49 UTC (rev 10037)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc 2014-04-17 14:04:50 UTC (rev 10038)
@@ -66,47 +66,31 @@
void ScriptController::moveToPosition_beta(float x, float y, float z )
{
- /*const Vector3 local=getPosition();
- const Vector3* target=new Vector3(x,y,z);
+ const Vector3 local=getPosition();
+ const Vector3 target=Vector3(x,y,z);
- setDirection(target, TransformSpace relativeTo = WorldEntity::Local, local);
+ Vector3 way=target-local;
- float dist = (target - local).length();
+
+ this->controlled->lookAt(target);
- moveFrontBack(dist);*/
+ this->controlled->moveFrontBack(way.length());
- orxout()<<x<<" "<<y<<" "<<z<<endl;
+ /*orxout()<<x<<" "<<y<<" "<<z<<endl;*/
- //this->controlled->rotateYaw(-sgn(coord.x)*coord.x*coord.x); erkennt coord nicht
- //this->controlled->rotatePitch(sgn(coord.y)*coord.y*coord.y);
+
+
}
- /* TO DO; noetige bewegungsfunktionen mit geschw., verbleibzeit.. als parameter*/
+ /* TODO: hilfs(zwischen)funktionen um lua eingabe zu ermoeglichen: zb moveToPosition(float...) weil in LUA wohl
+ kein vektor3 definierbar ist
- /*void WaypointController::tick(float dt) //copied from waypointcontroller
- {
- if (!this->isActive())
- return;
+ NB: viele noetige funktionen sind schon in artificial- bzw formationcontroller vorhanden
- if (this->waypoints_.size() == 0 || !this->getControllableEntity())
- return;
+ tick funktion?*/
- if (this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_)
- this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
- this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
- }*/
- /* TO DO
- in the constuctor: make accessible functions such as moveToPosition.. in LUA
- ->tolua++ example: http://usefulgamedev.weebly.com/tolua-example.html*/
-
-
-
- //function to execute the luafile
-
-
-
}
More information about the Orxonox-commit
mailing list