Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2005, 12:55:19 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: reimplemented the lifeTime function of particles (a little bit slower, but much more efficient)
Color also implemented with the new TimeCode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/story_entities/world.cc

    r4190 r4192  
    492492
    493493
     494  // Creating a Test Particle System
    494495  ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE);
    495   system->setLifeSpan(3);
    496   system->setConserve(.9);
    497   system->setRadius(2, 0, 2, 0);
    498 
     496  system->setLifeSpan(1);
     497  system->setConserve(.8);
     498  system->setRadius(4, 0, 1, 0);
     499  system->setColor(1,0,0,1, 1,1,0,1, 0,0,0,0);
     500
     501  // Creating a Test Particle Emitter
    499502  ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_4, 400, .5);
    500503  emitter->setParent(this->localPlayer);
    501  
     504  emitter->setRelCoor(Vector(0,-3,0));
     505 
     506  // Add the Flow from the Emitter into the System
     507  particleEngine->addConnection(emitter, system);
     508
     509
     510  // Creating Some Fields
    502511  Field* twirl = new Twirl();
    503512  twirl->setMagnitude(.1);
    504513  Field* gravity = new PointGravity();
    505514  gravity->setMagnitude(.5);
    506     new PhysicsConnection(system, twirl);
    507     //    new PhysicsConnection(system, gravity);
    508     twirl->setParent(this->localCamera->getTarget());
    509     gravity->setParent(this->localCamera->getTarget());
    510     particleEngine->addConnection(emitter, system);
     515  twirl->setParent(this->localCamera->getTarget());
     516  gravity->setParent(this->localCamera->getTarget());
     517
     518  //  new PhysicsConnection(system, twirl);
     519  //    new PhysicsConnection(system, gravity);
     520
    511521}
    512522
Note: See TracChangeset for help on using the changeset viewer.