Index: trunk/src/lib/particles/particle_emitter.cc
===================================================================
--- trunk/src/lib/particles/particle_emitter.cc	(revision 6627)
+++ trunk/src/lib/particles/particle_emitter.cc	(revision 6822)
@@ -21,5 +21,4 @@
 
 #include "load_param.h"
-#include "factory.h"
 #include "debug.h"
 #include "stdlibincl.h"
@@ -27,7 +26,4 @@
 using namespace std;
 
-
-CREATE_FACTORY(ParticleEmitter, CL_PARTICLE_EMITTER);
-
 /**
  *  standard constructor
@@ -36,22 +32,16 @@
                   float velocity)
 {
-  this->init();
-
+  this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
+
+  this->system = NULL;
+
+  this->setInheritSpeed(PARTICLE_EMITTER_DEFAULT_INHERIT_SPEED);
+  this->setEmissionMomentum(0);
   this->direction = direction;
   this->setSpread(angle);
   this->setEmissionRate(emissionRate);
   this->setEmissionVelocity(velocity);
-}
-
-/**
- *  constructs and loads a ParticleEmitter from a XML-element
- * @param root the XML-element to load from
-*/
-ParticleEmitter::ParticleEmitter(const TiXmlElement* root)
-{
-  this->init();
-
-   if (root != NULL)
-     this->loadParams(root);
+
+  this->saveTime = 0.0;
 }
 
@@ -64,25 +54,4 @@
 {
   this->setSystem(NULL);
-}
-
-/**
-  @brief initializes default values of a ParitcleEmitter
-*/
-void ParticleEmitter::init()
-{
-  this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
-
-  this->type = PARTICLE_EMITTER_DEFAULT_TYPE;
-  this->emitterSize = PARTICLE_EMITTER_DEFAULT_SIZE;
-  this->setInheritSpeed(PARTICLE_EMITTER_DEFAULT_INHERIT_SPEED);
-  this->setEmissionRate(PARTICLE_EMITTER_DEFAULT_EMISSION_RATE);
-  this->setSize(PARTICLE_EMITTER_DEFAULT_SIZE);
-  this->setEmissionMomentum(0);
-  this->setEmissionVelocity(1.0);
-  this->setSpread(M_PI);
-
-  this->system = NULL;
-
-  this->saveTime = 0.0;
 }
 
@@ -94,10 +63,4 @@
 {
   PNode::loadParams(root);
-
-  LoadParam(root, "type", this, ParticleEmitter, setType)
-    .describe("What type of emitter is this [dot, plane, cube, sphere].");
-
-  LoadParam(root, "size", this, ParticleEmitter, setSize)
-    .describe("How big the emitter is (no effect on dot-emitters)");
 
   LoadParam(root, "rate", this, ParticleEmitter, setEmissionRate)
@@ -139,55 +102,4 @@
 void ParticleEmitter::stop() {}
 
-
-
-
-
-/**
- * @param type the new Type of this emitter
-*/
-void ParticleEmitter::setType(EMITTER_TYPE type)
-{
-  this->type = type;
-}
-
-/**
- *  sets the type of emitter
- * @param type the type as a const char*
-   dot: EMITTER_DOT, plane: EMITTER_PLANE, cube: EMITTER_CUBE, sphere, EMITTER_SPHERE;
-*/
-void ParticleEmitter::setType(const char* type)
-{
-  if (!strcmp(type, "plane"))
-    this->setType(EMITTER_PLANE);
-  else if (!strcmp(type, "cube"))
-    this->setType(EMITTER_CUBE);
-  else if (!strcmp(type, "sphere"))
-    this->setType(EMITTER_SPHERE);
-  else
-    this->setType(EMITTER_DOT);
-}
-
-const char* ParticleEmitter::getTypeC() const
-{
-  if (this->type == EMITTER_PLANE)
-    return "EMITTER_PLANE";
-  else if (this->type == EMITTER_CUBE)
-    return "EMITTER_CUBE";
-  else if (this->type == EMITTER_SPHERE)
-    return "EMITTER_SPHERE";
-  else
-    return "EMITTER_DOT";
-}
-
-/**
- *  sets a new size to the emitter
-*/
-void ParticleEmitter::setSize(float emitterSize)
-{
-  if (emitterSize > 0.0)
-    this->emitterSize = emitterSize;
-  else
-    emitterSize = 0.0;
-}
 
 /**
@@ -280,7 +192,9 @@
     PRINTF(5)("emitting %f particles, saving %f seconds for the next timestep\n", count, this->saveTime);
 
-    if (likely(count > 0))
+    if (likely(count > 0.0f))
     {
-      Vector inheritVelocity = this->getVelocity() * this->inheritSpeed;
+      this->emitParticles((unsigned int)count);
+
+/*      Vector inheritVelocity = this->getVelocity() * this->inheritSpeed;
       for (int i = 0; i < (int)count; i++)
       {
@@ -294,13 +208,13 @@
         Vector extension; // the Vector for different fields.
 
-        if (this->type & EMITTER_PLANE)
-        {
-          extension = Vector(this->emitterSize * ((float)rand()/RAND_MAX -.5), 0, this->emitterSize * ((float)rand()/RAND_MAX - .5));
-          extension = this->getAbsDir().apply(extension);
-        }
-        else if (this->type & EMITTER_CUBE)
-        {
-          extension = Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * this->emitterSize;
-        }
+//         if (this->type & EMITTER_PLANE)
+//         {
+//           extension = Vector(this->emitterSize * ((float)rand()/RAND_MAX -.5), 0, this->emitterSize * ((float)rand()/RAND_MAX - .5));
+//           extension = this->getAbsDir().apply(extension);
+//         }
+//         else if (this->type & EMITTER_CUBE)
+//         {
+//           extension = Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * this->emitterSize;
+//         }
 
 
@@ -312,5 +226,5 @@
 
         this->system->addParticle(this->getAbsCoor() + extension - equalSpread, velocityV, orient, moment);
-      }
+      } */
     }
   }
@@ -322,6 +236,5 @@
 void ParticleEmitter::debug() const
 {
-  PRINT(0)(" Emitter %s\n", this->getName());
+  PRINT(0)(" ParticleEmitter %s::%s\n", this->getClassName(), this->getName());
   PRINT(0)("  EmissionRate: %f, Speed: %f, SpreadAngle: %f\n", this->getEmissionRate(), this->getEmissionVelocity(), this->getSpread());
-  PRINT(0)("  Size %f, Type: %s\n", this->getSize(), this->getTypeC());
-}
+}
