Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 5, 2008, 6:46:43 PM (17 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

Location:
code/branches/core2/src/orxonox/objects
Files:
3 edited

Legend:

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

    r790 r995  
    3232#include <OgreSceneNode.h>
    3333
    34 #include "../core/CoreIncludes.h"
     34#include "core/CoreIncludes.h"
     35#include "core/Executor.h"
     36
    3537#include "util/Math.h"
    3638#include "../Orxonox.h"
     
    5254        if (owner)
    5355        {
    54             this->destroyTimer_.setTimer(this->lifetime_, false, this, &Explosion::destroyObject);
     56            this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Explosion::destroyObject)));
    5557
    5658            Vector3 position = owner->getNode()->getWorldPosition();
  • code/branches/core2/src/orxonox/objects/Projectile.cc

    r957 r995  
    2828#include "OrxonoxStableHeaders.h"
    2929
    30 #include "../core/CoreIncludes.h"
     30#include "core/CoreIncludes.h"
     31#include "core/Executor.h"
     32
    3133#include "SpaceShip.h"
    3234#include "Explosion.h"
     
    6062        }
    6163
    62         this->destroyTimer_.setTimer(this->lifetime_, false, this, &Projectile::destroyObject);
     64        this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
    6365    }
    6466
  • 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.