Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 17, 2014, 2:24:12 PM (11 years ago)
Author:
samuezu
Message:

orxout in sc fct movetoposition

Location:
code/branches/ScriptableController/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc

    r10028 r10034  
    3030#include "core/CoreIncludes.h"
    3131#include "worldentities/ControllableEntity.h"
     32#include <cmath>
    3233
    3334namespace orxonox
     
    5859    }
    5960
    60     void ScriptController::moveToPosition(const Vector3& target)
     61    const Vector3& ScriptController::getPosition()
    6162    {
    62        
    63         /*this->controlled_->rotateYaw(-sgn(coord.x)*coord.x*coord.x);
    64         this->controlled_->rotatePitch(sgn(coord.y)*coord.y*coord.y);*/
     63        return this->controlled->getPosition();
    6564    }
     65
     66    void ScriptController::moveToPosition_beta(float x, float y, float z )
     67    {
     68
     69       /*const Vector3 local=getPosition();
     70       const Vector3* target=new Vector3(x,y,z);
     71
     72        setDirection(target, TransformSpace relativeTo = WorldEntity::Local, local);
     73
     74        float dist = (target - local).length();
     75
     76        moveFrontBack(dist);*/
     77
     78        orxout()<<x<<"  "<<y<<"  "<<z<<endl;
     79
     80
     81
     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    }
     85
     86    /* TO DO; noetige bewegungsfunktionen mit geschw., verbleibzeit.. als parameter*/
    6687
    6788    /*void WaypointController::tick(float dt)  //copied from waypointcontroller
  • code/branches/ScriptableController/src/orxonox/controllers/ScriptController.h

    r10028 r10034  
    5656            // LUA interface
    5757            // tolua_begin
    58             void moveToPosition(const Vector3& target);
     58            void moveToPosition_beta(float x, float y, float z);
    5959
    6060           
    61 
     61            const Vector3& getPosition();
    6262           
    6363              /* virtual void tick(float dt);*/
Note: See TracChangeset for help on using the changeset viewer.