Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4639 in orxonox.OLD


Ignore:
Timestamp:
Jun 16, 2005, 1:59:25 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: particleFun draws some Particles again

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/particles/particle_emitter.cc

    r4597 r4639  
    4242  this->setEmissionRate(emissionRate);
    4343  this->setEmissionVelocity(velocity);
     44
     45  ParticleEngine::getInstance()->addEmitter(this);
    4446}
    4547
     
    129131{
    130132  if (!strcmp(type, "plane"))
    131     this->type = EMITTER_PLANE;
     133    this->setType(EMITTER_PLANE);
    132134  else if (!strcmp(type, "cube"))
    133     this->type = EMITTER_CUBE;
     135    this->setType(EMITTER_CUBE);
    134136  else if (!strcmp(type, "sphere"))
    135     this->type = EMITTER_SPHERE;
    136   else
    137     this->type = EMITTER_DOT;
     137    this->setType(EMITTER_SPHERE);
     138  else
     139    this->setType(EMITTER_DOT);
     140}
     141
     142const char* ParticleEmitter::getTypeC(void) const
     143{
     144  if (this->type == EMITTER_PLANE)
     145    return "EMITTER_PLANE";
     146  else if (this->type == EMITTER_CUBE)
     147    return "EMITTER_CUBE";
     148  else if (this->type == EMITTER_SPHERE)
     149    return "EMITTER_SPHERE";
     150  else
     151    return "EMITTER_DOT";
     152
     153
    138154}
    139155
     
    262278   \brief outputs some nice debug information
    263279*/
    264 void ParticleEmitter::debug(void)
     280void ParticleEmitter::debug(void) const
    265281{
    266282  PRINT(0)(" Emitter %s\n", this->getName());
    267 }
     283  PRINT(0)("  EmissionRate: %f, Speed: %f, SpreadAngle: %f\n", this->getEmissionRate(), this->getEmissionVelocity(), this->getSpread());
     284  PRINT(0)("  Size %f, Type: %s\n", this->getSize(), this->getTypeC());
     285}
  • orxonox/trunk/src/lib/particles/particle_emitter.h

    r4597 r4639  
    4949  /** \returns the type of the emitter */
    5050  inline EMITTER_TYPE getType(void) const { return this->type; };
     51  /** \returns the Type as a const char * */
     52  const char* getTypeC(void) const;
    5153  /** \returns the Size of the emitter */
    5254  inline float getSize(void) const { return this->emitterSize; };
     
    5658  inline float getInheritSpeed(void) const { return this->inheritSpeed; };
    5759  /** \returns the SpreadAngle of the emitter */
    58   inline float getSpread(void) { return this->angle; };
     60  inline float getSpread(void) const { return this->angle; };
    5961  /** \returns the EmissionVelocity of the emitter */
    60   inline float getEmissionVelocity(void) { return this->velocity; };
     62  inline float getEmissionVelocity(void) const { return this->velocity; };
    6163
    62   void debug(void);
     64  void debug(void) const;
    6365
    6466
  • orxonox/trunk/src/lib/particles/particle_engine.cc

    r4597 r4639  
    357357  PRINT(0)(" Reference: %p\n", ParticleEngine::singletonRef);
    358358  PRINT(0)(" Count: Emitters: %d; Systems: %d, Connections: %d\n",
    359             this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize());
     359  this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize());
     360
    360361  if (this->connectionList->getSize() > 0)
    361     {
    362       PRINT(0)(" Connections:\n");
    363       PRINT(0)(" -----------------------------------\n");
    364 
    365       tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
    366       ParticleConnection* tmpConnection = tmpConIt->nextElement();
    367       while(tmpConnection)
    368         {
    369           PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName());
    370           tmpConnection = tmpConIt->nextElement();
    371         }
    372       delete tmpConIt;
    373     }
     362  {
     363    PRINT(0)(" Connections:\n");
     364    PRINT(0)(" -----------------------------------\n");
     365
     366    tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
     367    ParticleConnection* tmpConnection = tmpConIt->nextElement();
     368    while(tmpConnection)
     369    {
     370      PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName());
     371      tmpConnection = tmpConIt->nextElement();
     372    }
     373    delete tmpConIt;
     374  }
     375
    374376  if (this->systemList->getSize() > 0)
    375     {
    376       tIterator<ParticleSystem>* tmpIt = systemList->getIterator();
    377       ParticleSystem* tmpSys = tmpIt->nextElement();
    378       while(tmpSys)
    379         {
    380           tmpSys->debug();
    381           tmpSys = tmpIt->nextElement();
    382         }
    383       delete tmpIt;
    384     }
     377  {
     378    tIterator<ParticleSystem>* tmpIt = systemList->getIterator();
     379    ParticleSystem* tmpSys = tmpIt->nextElement();
     380    while(tmpSys)
     381    {
     382      tmpSys->debug();
     383      tmpSys = tmpIt->nextElement();
     384    }
     385    delete tmpIt;
     386  }
     387  else
     388  {
     389    PRINT(0)("NO SYSTEMS\n");
     390  }
     391  if (this->emitterList->getSize() > 0)
     392  {
     393    tIterator<ParticleEmitter>* tmpIt = emitterList->getIterator();
     394    ParticleEmitter* tmpEmit = tmpIt->nextElement();
     395    while(tmpEmit)
     396    {
     397      tmpEmit->debug();
     398      tmpEmit = tmpIt->nextElement();
     399    }
     400    delete tmpIt;
     401  }
     402  else
     403  {
     404    PRINTF(0)("NO EMITTERS\n");
     405  }
    385406
    386407  PRINT(0)("+--------------------------------PE-+\n");
  • orxonox/trunk/src/subprojects/importer/Makefile.in

    r4634 r4639  
    205205importer_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \
    206206                 $(MAINSRCDIR)/lib/tinyxml/libtinyxml.a \
    207                 $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a
     207                $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a
    208208
    209209importer_SOURCES = ../framework.cc \
    210                   importer.cc \
    211                   $(MAINSRCDIR)/lib/graphics/light.cc \
    212                   $(MAINSRCDIR)/util/state.cc \
    213                   $(MAINSRCDIR)/world_entities/camera.cc \
    214                   $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \
    215                   $(MAINSRCDIR)/lib/lang/base_object.cc \
    216                   $(MAINSRCDIR)/lib/math/vector.cc \
    217                   $(MAINSRCDIR)/util/resource_manager.cc \
    218                   $(MAINSRCDIR)/lib/util/ini_parser.cc \
    219                   $(MAINSRCDIR)/lib/graphics/text_engine.cc \
    220                   $(MAINSRCDIR)/lib/coord/p_node.cc \
    221                   $(MAINSRCDIR)/lib/coord/null_parent.cc \
    222                   $(MAINSRCDIR)/util/loading/load_param.cc \
    223                   $(MAINSRCDIR)/lib/util/substring.cc
     210                  importer.cc \
     211                  $(MAINSRCDIR)/lib/graphics/light.cc \
     212                  $(MAINSRCDIR)/util/state.cc \
     213                  $(MAINSRCDIR)/world_entities/camera.cc \
     214                  $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \
     215                  $(MAINSRCDIR)/lib/lang/base_object.cc \
     216                  $(MAINSRCDIR)/lib/math/vector.cc \
     217                  $(MAINSRCDIR)/util/resource_manager.cc \
     218                  $(MAINSRCDIR)/lib/util/ini_parser.cc \
     219                  $(MAINSRCDIR)/lib/graphics/text_engine.cc \
     220                  $(MAINSRCDIR)/lib/coord/p_node.cc \
     221                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
     222                  $(MAINSRCDIR)/util/loading/load_param.cc \
     223                  $(MAINSRCDIR)/lib/util/substring.cc
    224224
    225225all: all-am
  • orxonox/trunk/src/subprojects/particles/particle_fun.cc

    r4637 r4639  
    4949
    5050  // Creating a Test Particle System
     51
    5152  ParticleSystem* system = new ParticleSystem(100000, PINIT_PARTICLE_TYPE);
    5253  system->setRadius(0, PINIT_START_RADIUS, 0 );
     
    5556
    5657  system->setConserve(PINIT_CONSERVE_FACTOR);
    57   system->setMass(5,3,6);
     58  //system->setMass(5,3,6);
    5859
    5960  // Creating a Test Particle Emitter
Note: See TracChangeset for help on using the changeset viewer.