[Orxonox-commit 5371] r10034 - code/branches/ScriptableController/src/orxonox/controllers
samuezu at orxonox.net
samuezu at orxonox.net
Thu Apr 17 14:24:13 CEST 2014
Author: samuezu
Date: 2014-04-17 14:24:12 +0200 (Thu, 17 Apr 2014)
New Revision: 10034
Modified:
code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc
code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h
Log:
orxout in sc fct movetoposition
Modified: code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc 2014-04-16 18:59:17 UTC (rev 10033)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc 2014-04-17 12:24:12 UTC (rev 10034)
@@ -29,6 +29,7 @@
#include "ScriptController.h"
#include "core/CoreIncludes.h"
#include "worldentities/ControllableEntity.h"
+#include <cmath>
namespace orxonox
{
@@ -57,13 +58,33 @@
}
- void ScriptController::moveToPosition(const Vector3& target)
+ const Vector3& ScriptController::getPosition()
{
-
- /*this->controlled_->rotateYaw(-sgn(coord.x)*coord.x*coord.x);
- this->controlled_->rotatePitch(sgn(coord.y)*coord.y*coord.y);*/
+ return this->controlled->getPosition();
}
+ void ScriptController::moveToPosition_beta(float x, float y, float z )
+ {
+
+ /*const Vector3 local=getPosition();
+ const Vector3* target=new Vector3(x,y,z);
+
+ setDirection(target, TransformSpace relativeTo = WorldEntity::Local, local);
+
+ float dist = (target - local).length();
+
+ moveFrontBack(dist);*/
+
+ 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*/
+
/*void WaypointController::tick(float dt) //copied from waypointcontroller
{
if (!this->isActive())
Modified: code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h 2014-04-16 18:59:17 UTC (rev 10033)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h 2014-04-17 12:24:12 UTC (rev 10034)
@@ -55,10 +55,10 @@
// LUA interface
// tolua_begin
- void moveToPosition(const Vector3& target);
+ void moveToPosition_beta(float x, float y, float z);
-
+ const Vector3& getPosition();
/* virtual void tick(float dt);*/
More information about the Orxonox-commit
mailing list