Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3944 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
Apr 23, 2005, 2:48:57 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: debug function-headers written

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

Legend:

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

    r3938 r3944  
    4949ParticleEmitter::~ParticleEmitter ()
    5050{
    51    ParticleEngine::getInstance()->removeEmitter(this);
     51  ParticleEngine::getInstance()->removeEmitter(this);
    5252 
    5353}
     
    137137    }
    138138}
     139
     140/**
     141   \brief outputs some nice debug information
     142*/
     143void ParticleEmitter::debug(void)
     144{
     145
     146}
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.h

    r3935 r3944  
    3636  void setVelocity(float velocity, float randomVelocity = 0.0);
    3737
     38  void debug(void);
     39
    3840 private:
    3941  Vector direction;     //!< emition direction
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc

    r3943 r3944  
    204204
    205205}
     206
     207/**
     208   \brief outputs some nice debug information
     209*/
     210void ParticleEngine::debug(void)
     211{
     212  PRINT(0)("+-----------------------------------+\n");
     213  PRINT(0)("+ PARTICLE-ENGINE DEBUG INFORMATION +\n");
     214  PRINT(0)("+-----------------------------------+\n");
     215  PRINT(0)(" Reference: %p\n", ParticleEngine::singletonRef);
     216  PRINT(0)(" Count: Emitters: %d; Systems: %d, Connections: %d\n",
     217            this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize());
     218  if (this->connectionList->getSize() > 0)
     219    {
     220      PRINT(0)(" Connections:\n");
     221      PRINT(0)(" -----------------------------------\n");
     222
     223      tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
     224      ParticleConnection* tmpConnection = tmpConIt->nextElement();
     225      while(tmpConnection)
     226        {
     227          PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName());
     228          tmpConnection = tmpConIt->nextElement();
     229        }
     230      delete tmpConIt;
     231    }
     232  if (this->systemList->getSize() > 0)
     233    {
     234      tIterator<ParticleSystem>* tmpIt = systemList->getIterator();
     235      ParticleSystem* tmpSys = tmpIt->nextElement();
     236      while(tmpSys)
     237        {
     238          tmpSys->debug();
     239          tmpSys = tmpIt->nextElement();
     240        }
     241      delete tmpIt;
     242    }
     243
     244  PRINT(0)("+--------------------------------PE-+\n");
     245
     246}
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.h

    r3943 r3944  
    3939  bool breakConnection(ParticleConnection* connection);
    4040
     41  void debug();
     42
    4143 private:
    4244  ParticleEngine(void);
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc

    r3943 r3944  
    3535{
    3636   this->setClassName ("ParticleSystem");
    37 
     37   this->name = NULL;
    3838   this->maxCount = maxCount;
    3939   this->count = 0;
     
    5858  // delete what has to be deleted here
    5959   ParticleEngine::getInstance()->removeSystem(this);
     60}
     61
     62void ParticleSystem::setName(const char* name)
     63{
     64  if (this->name)
     65    delete this->name;
     66  this->name = new char[strlen(name)+1];
     67  strcpy(this->name, name);
     68}
     69
     70const char* ParticleSystem::getName(void) const
     71{
     72  return this->name;
    6073}
    6174
     
    248261}
    249262
     263
     264/**
     265   \brief outputs some nice debug information
     266*/
     267void ParticleSystem::debug(void)
     268{
     269  PRINT(0)("  ParticleSystem %s\n", this->name);
     270  PRINT(0)("  ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount);
     271}
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h

    r3942 r3944  
    4747  ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT, PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE);
    4848  virtual ~ParticleSystem();
     49  void setName(const char* name);
     50  const char* getName(void) const;
    4951
    5052  void setType(PARTICLE_TYPE particleType, int count = 0);
     
    5961  void draw(void);
    6062
     63  void debug(void);
     64
    6165 private:
     66  char* name;                // the Name of the Particle System
     67
    6268  float conserve;            //!< How much energy gets conserved to the next Tick.
    6369  float lifeSpan;            //!< Initial lifetime of a Particle.
  • orxonox/branches/particleEngine/src/story_entities/world.cc

    r3942 r3944  
    166166  AnimationPlayer::getInstance()->debug();
    167167  delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.
    168 
     168 
     169  ParticleEngine::getInstance()->debug();
    169170  delete ParticleEngine::getInstance();
    170171
     
    379380            ParticleEmitter* testEmitter,* testEmitter2;
    380381            ParticleSystem* testSystem;
    381             testEmitter = new ParticleEmitter(Vector(-1,0,0), M_PI_2, 1200.0, .5);
     382            testEmitter = new ParticleEmitter(Vector(-1,0,0), M_PI_2, 120.0, .5);
    382383            testEmitter->setParent(localPlayer);
    383384            testEmitter->setRelCoor(Vector(-3, 0, 0));
    384 
    385             testSystem = new ParticleSystem(100000);
     385            testEmitter->setName("ship emitter");
     386            testEmitter2 = new ParticleEmitter(Vector(1,0,0), .1, 120.0, 1);
     387            testEmitter2->setParent(tn);
     388            testEmitter2->setName("crap emitter");
     389           
     390            testSystem = new ParticleSystem(1000);
    386391            testSystem->setLifeSpan(1, .8);
    387392            testSystem->setRadius(1.0, 0.0, .5);
    388393            testSystem->setConserve(.8);
    389394            testSystem->setInheritSpeed(1);
    390 
     395            testSystem->setName("system");
    391396            ParticleEngine::getInstance()->addConnection(testEmitter, testSystem);
     397            ParticleEngine::getInstance()->addConnection(testEmitter2, testSystem);
     398            ParticleEngine::getInstance()->debug();
    392399
    393400            break;
Note: See TracChangeset for help on using the changeset viewer.