Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 17, 2014, 4:04:50 PM (11 years ago)
Author:
samuezu
Message:

scriptcontroller slightly modified

File:
1 edited

Legend:

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

    r10034 r10038  
    6767    {
    6868
    69        /*const Vector3 local=getPosition();
    70        const Vector3* target=new Vector3(x,y,z);
     69       const Vector3 local=getPosition();
     70       const Vector3 target=Vector3(x,y,z);
    7171
    72         setDirection(target, TransformSpace relativeTo = WorldEntity::Local, local);
     72       Vector3 way=target-local;
    7373
    74         float dist = (target - local).length();
     74       
     75       this->controlled->lookAt(target);
    7576
    76         moveFrontBack(dist);*/
     77        this->controlled->moveFrontBack(way.length());     
    7778
    78         orxout()<<x<<"  "<<y<<"  "<<z<<endl;
     79
     80        /*orxout()<<x<<"  "<<y<<"  "<<z<<endl;*/
    7981
    8082
    8183
    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         
    8485    }
    8586
    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
    8789
    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
    9291
    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?*/       
    10993
    11094
Note: See TracChangeset for help on using the changeset viewer.