Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3937 in orxonox.OLD for orxonox/branches/particleEngine/src


Ignore:
Timestamp:
Apr 23, 2005, 4:01:07 AM (20 years ago)
Author:
bensch
Message:

orxonox/brnaches/particleEngine: multiple emitions into one ParticleSystem

Location:
orxonox/branches/particleEngine/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc

    r3935 r3937  
    8282void ParticleEngine::addConnection(ParticleEmitter* emitter, ParticleSystem* system)
    8383{
     84  // look, if we have already added this connection
     85  tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
     86  ParticleConnection* tmpConnection = tmpConIt->nextElement();
     87  while(tmpConnection)
     88    {
     89      if (tmpConnection->emitter == emitter && tmpConnection->system == system)
     90        {
     91          PRINTF(2)("Connection between Emitter and System already added\n");
     92          delete tmpConIt;
     93          return;
     94        }
     95     
     96      tmpConnection = tmpConIt->nextElement();
     97    }
     98  delete tmpConIt;
     99 
     100
     101
    84102  ParticleConnection* tmpCon = new ParticleConnection;
    85103  tmpCon->emitter = emitter;
     
    93111{
    94112  this->systemList->remove(system);
    95  
    96113}
    97114
  • orxonox/branches/particleEngine/src/story_entities/world.cc

    r3936 r3937  
    377377            this->glmis->step();
    378378           
    379             testEmitter = new ParticleEmitter(Vector(-1,0,0), .1, 12400.0, .5);
     379            ParticleEmitter* testEmitter,* testEmitter2;
     380            ParticleSystem* testSystem;
     381            testEmitter = new ParticleEmitter(Vector(-1,0,0), .1, 1200.0, .5);
    380382            testEmitter->setParent(localPlayer);
    381383            testEmitter->setSpread(M_PI_4, .1);
     384            testEmitter2 = new ParticleEmitter(Vector(-1,0,0), .1, 1200, .5);
     385            testEmitter2->setParent(tn);
     386
    382387            testSystem = new ParticleSystem(100000);
    383388            testSystem->setLifeSpan(3);
     
    385390
    386391            ParticleEngine::getInstance()->addConnection(testEmitter, testSystem);
     392            ParticleEngine::getInstance()->addConnection(testEmitter2, testSystem);
    387393
    388394            break;
  • orxonox/branches/particleEngine/src/story_entities/world.h

    r3932 r3937  
    2525class GarbageCollector;
    2626class Text;
    27 
    28 class ParticleEmitter;
    29 class ParticleSystem;
    3027
    3128//! The game world Interface
     
    112109  Terrain* terrain;                   //!< The Terrain of the World.
    113110
    114   ParticleSystem* testSystem;
    115   ParticleEmitter* testEmitter;
    116 
    117111  GLuint objectList;                  //!< temporary: \todo this will be ereased soon
    118112  tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
Note: See TracChangeset for help on using the changeset viewer.