Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4305 in orxonox.OLD for orxonox/branches/physics/src


Ignore:
Timestamp:
May 26, 2005, 4:04:18 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: moved the initialisation to the top

Location:
orxonox/branches/physics/src/subprojects/particles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4304 r4305  
    3030int verbose;
    3131
     32void Framework::initModule()
     33{
     34  // Creating a Test Particle System
     35  ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE);
     36  system->setLifeSpan(5);
     37  system->setConserve(.99);
     38  system->setRadius(4, 3, 1, 2);
     39  system->setColor(.5,0,0,.5, 1,1,0,1, 0,0,0,0);
     40
     41  // Creating a Test Particle Emitter
     42  ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 1, 0), M_PI_4, 20, .1);
     43  emitter->setType(EMITTER_DOT  );
     44  emitter->setSize(0);
     45  emitter->setRelCoor(Vector(0,0,0));
     46 
     47  // Add the Flow from the Emitter into the System
     48  ParticleEngine::getInstance()->addConnection(emitter, system);
     49}
     50
    3251bool Framework::mainLoop()
    3352{
     
    7998    // And poll for events
    8099    SDL_Event event;
    81     SDL_PollEvent(&event) ;
     100    while(SDL_PollEvent(&event))
    82101    {
    83102      switch (event.type) {
     
    232251  ResourceManager::getInstance()->setDataDir(DATA_DIRECTORY);
    233252 
    234   // Creating a Test Particle System
    235   ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE);
    236   system->setLifeSpan(5);
    237   system->setConserve(.99);
    238   system->setRadius(4, 3, 1, 2);
    239   system->setColor(.5,0,0,.5, 1,1,0,1, 0,0,0,0);
    240 
    241   // Creating a Test Particle Emitter
    242   ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 1, 0), M_PI_4, 20, .1);
    243   emitter->setType(EMITTER_DOT  );
    244   emitter->setSize(0);
    245   emitter->setRelCoor(Vector(0,0,0));
    246  
    247   // Add the Flow from the Emitter into the System
    248   ParticleEngine::getInstance()->addConnection(emitter, system);
     253
     254  initModule();
    249255
    250256  camera = new Camera();
    251257
    252   State::getInstance()->setCamera(camera, emitter);
     258  State::getInstance()->setCamera(camera, camera->getTarget());
    253259
    254260  camera->setAbsCoor(Vector(10, 10, 0));
  • orxonox/branches/physics/src/subprojects/particles/framework.h

    r4300 r4305  
    2727  ~Framework();
    2828 
     29  void initModule();
    2930  bool mainLoop();
    3031  bool draw(float dt);
Note: See TracChangeset for help on using the changeset viewer.