Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 1, 2015, 10:03:10 AM (8 years ago)
Author:
gania
Message:

decided to get rid of action timer and call action in tick instead: action is being called once in 2 sec in a tick, 2 sec were split in 4 * 0.25 sec, with 0.25 sec gap for each member of division to call its action, resulted in significant speed up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc

    r10886 r10909  
    4343        this->myFollower_ = 0;
    4444        this->myWingman_ = 0;
    45         this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DivisionController::action, this)));
     45        //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DivisionController::action, this)));
    4646    }
    4747
     
    6868            return;   
    6969        SUPER(DivisionController, tick, dt);
     70        if (this->timeOffset_ >= 0.0f && this->timeOffset_ <= 0.5f && !this->bActionCalled_)
     71        {
     72            this->action();
     73            this->bActionCalled_ = true;
     74        }
     75        if (this->timeOffset_ > 1.0f)
     76        {
     77            this->bActionCalled_ = false;
     78        }
     79
     80       
    7081    }
    7182    void DivisionController::action()
Note: See TracChangeset for help on using the changeset viewer.