Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 19, 2016, 5:34:38 PM (9 years ago)
Author:
plehmann
Message:

modified newScriptController to prevent memory leacks caused by tasks

Location:
code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.cc

    r11187 r11190  
    4949        this->entity_ = this->player_->getControllableEntity();
    5050        this->destination_ = destination;
     51        this->velocity_ = velocity;
    5152        this->entity->setVelocity( Vector3(0,0,0) )
    5253    }
     
    5556    {
    5657
     58        float dl = this->velocity_ * dt;
    5759
     60       
    5861        /* Set the position to the correct place in the trajectory */
    5962        this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1);
  • code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/MoveToTask.h

    r11187 r11190  
    6262            vector3 destination_;
    6363
     64            float velocity_;
     65
    6466    };
    6567}
  • code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.cc

    r11183 r11190  
    3838    RegisterClass(Task);
    3939
    40     Task::Task(Context* context)
     40    Task::Task(Context* context) : BaseObject(context)
    4141    {
    4242        RegisterObject(Task);
     
    4949    }
    5050
    51     bool Task::update(float dt)
    52     {
    53         SUPER(Task, tick, dt);
    54     }
    55 
    5651}
  • code/branches/plehmannFS16/src/orxonox/controllers/scriptTasks/Task.h

    r11183 r11190  
    3232#include "infos/PlayerInfo.h"
    3333#include "tools/interfaces/Tickable.h"
    34 #include "core/class/OrxonoxClass.h"
     34//#include "core/class/OrxonoxClass.h"
     35#include "core/BaseObject.h"
    3536
    3637namespace orxonox
    3738{
    38     class _OrxonoxExport Task : public OrxonoxClass {
     39    class _OrxonoxExport Task : public BaseObject {
    3940   
    4041        public:
     
    4647
    4748            //important return true while the task is running and false to stop it!!!
    48             virtual bool update(float dt);
     49            virtual bool update(float dt) {return false;}
    4950
    5051            float getStartTime()
Note: See TracChangeset for help on using the changeset viewer.