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/SectionController.cc

    r10906 r10909  
    4444        this->setFormationMode(FormationMode::FINGER4);
    4545
    46         this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&SectionController::action, this)));
     46        //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&SectionController::action, this)));
    4747        this->myWingman_ = 0;
    4848        this->myDivisionLeader_ = 0;
     
    7474   
    7575        SUPER(SectionController, tick, dt);
     76        if (this->timeOffset_ >= 0.5f && this->timeOffset_ <= 1.0f && !this->bActionCalled_)
     77        {
     78            this->action();
     79            this->bActionCalled_ = true;
     80        }
     81        if (this->timeOffset_ > 1.5f)
     82        {
     83            this->bActionCalled_ = false;
     84        }
    7685    }
    7786
Note: See TracChangeset for help on using the changeset viewer.