Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 5, 2008, 6:46:43 PM (16 years ago)
Author:
landauf
Message:

added 'delay time command' console command that executes 'command' after 'time' seconds. it uses a automatically destroying timer for every execution, so you can start several delayed commands at the same time without overwriting older entries.

and this is great:

append disco.txt delay 0.0 Ambient setAmbientLightTest 1,0,0,1
append disco.txt delay 0.2 Ambient setAmbientLightTest 0,1,0,1
append disco.txt delay 0.4 Ambient setAmbientLightTest 0,0,1,1
append disco.txt delay 0.6 exec disco.txt

exec disco.txt

and you'll have disco in space… forever! :D

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/objects/test2.cc

    r871 r995  
    3030#include "test3.h"
    3131#include "core/CoreIncludes.h"
     32#include "core/Executor.h"
    3233
    3334namespace orxonox
     
    4344        this->usefullClass3_ = Class(Test3);
    4445
    45         timer1.setTimer(1, true, this, &Test2::timerFunction1);
    46         timer2.setTimer(5, true, this, &Test2::timerFunction2);
    47         timer3.setTimer(10, false, this, &Test2::timerFunction3);
     46        timer1.setTimer(1, true, this, createExecutor(createFunctor(&Test2::timerFunction1)));
     47        timer2.setTimer(5, true, this, createExecutor(createFunctor(&Test2::timerFunction2)));
     48        timer3.setTimer(10, false, this, createExecutor(createFunctor(&Test2::timerFunction3)));
    4849    }
    4950
Note: See TracChangeset for help on using the changeset viewer.