Index: /trunk/src/lib/particles/Makefile.am
===================================================================
--- /trunk/src/lib/particles/Makefile.am	(revision 6822)
+++ /trunk/src/lib/particles/Makefile.am	(revision 6823)
@@ -7,4 +7,5 @@
 			particle_emitter.cc \
 			dot_emitter.cc \
+			box_emitter.cc \
 			\
 			particle_system.cc \
@@ -20,4 +21,5 @@
 			particle_emitter.h \
 			dot_emitter.h \
+			box_emitter.h \
 			\
 			particle_system.h \
Index: /trunk/src/lib/particles/box_emitter.cc
===================================================================
--- /trunk/src/lib/particles/box_emitter.cc	(revision 6823)
+++ /trunk/src/lib/particles/box_emitter.cc	(revision 6823)
@@ -0,0 +1,107 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: Patrick Boenzli
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
+
+#include "box_emitter.h"
+
+#include "particle_system.h"
+
+#include "load_param.h"
+#include "factory.h"
+#include "debug.h"
+#include "stdlibincl.h"
+
+using namespace std;
+
+
+CREATE_FACTORY(BoxEmitter, CL_BOX_EMITTER);
+
+/**
+ *  standard constructor
+*/
+BoxEmitter::BoxEmitter(const Vector& size)
+{
+  this->init();
+  this->setSize(size);
+}
+
+/**
+ *  constructs and loads a BoxEmitter from a XML-element
+ * @param root the XML-element to load from
+*/
+BoxEmitter::BoxEmitter(const TiXmlElement* root)
+    : ParticleEmitter()
+{
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard destructor
+
+   removes the EmitterSystem from the ParticleEngine
+*/
+BoxEmitter::~BoxEmitter ()
+{
+  this->setSystem(NULL);
+}
+
+/**
+  @brief initializes default values of a ParitcleEmitter
+*/
+void BoxEmitter::init()
+{
+  this->setClassID(CL_BOX_EMITTER, "BoxEmitter");
+  this->setSize(1.0f,1.0f,1.0f);
+}
+
+void BoxEmitter::loadParams(const TiXmlElement* root)
+{
+  ParticleEmitter::loadParams(root);
+
+  LoadParam(root, "size", this, BoxEmitter, setSize)
+  .describe("The Size of the BoxEmitter: x, y, z")
+  .defaultValues(3, 1.0f,1.0f,1.0f);
+}
+
+void BoxEmitter::emitParticles(unsigned int count) const
+{
+  Vector inheritVelocity = this->getVelocity() * this->inheritSpeed;
+
+  for (unsigned int i = 0; i < count; i++)
+  {
+    Vector randDir = Vector(rand()-RAND_MAX/2, rand()-RAND_MAX/2, rand()-RAND_MAX/2);
+    randDir.normalize();
+    randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)rand()/RAND_MAX -.5), randDir)).apply(this->direction);
+    Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity;
+
+    Vector extension = Vector(((float)rand()/RAND_MAX -.5)*this->size.x,
+                              ((float)rand()/RAND_MAX -.5) *this->size.y,
+                              ((float)rand()/RAND_MAX -.5) * this->size.z);
+
+
+    // ROTATIONAL CALCULATION (this must not be done for all types of particles.)
+    randDir = Vector(rand()-RAND_MAX/2, rand()-RAND_MAX/2, rand()-RAND_MAX/2);
+    randDir.normalize();
+    Quaternion orient = Quaternion(M_PI, randDir);
+    Quaternion moment = Quaternion(this->momentum + this->momentumRandom, randDir);
+
+    this->getSystem()->addParticle(this->getAbsCoor() + extension, velocityV, orient, moment);
+
+  }
+}
Index: /trunk/src/lib/particles/box_emitter.h
===================================================================
--- /trunk/src/lib/particles/box_emitter.h	(revision 6823)
+++ /trunk/src/lib/particles/box_emitter.h	(revision 6823)
@@ -0,0 +1,34 @@
+/*!
+ * @file box_emitter.h
+ *  Definition of a BoxEmitter
+ */
+
+#ifndef _BOX_EMITTER_H
+#define _BOX_EMITTER_H
+
+#include "particle_emitter.h"
+
+//! A class to handle an Emitter.
+class BoxEmitter : public ParticleEmitter
+{
+  friend class ParticleSystem;
+public:
+  BoxEmitter(const Vector& size);
+  BoxEmitter(const TiXmlElement* root);
+  virtual ~BoxEmitter();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void setSize(float x, float y, float z);
+  void setSize(const Vector& size) { this->setSize(size.x, size.y, size.z); };
+
+  virtual void emitParticles(unsigned int count) const;
+
+private:
+  void init();
+
+private:
+  Vector      size;
+};
+
+#endif /* _BOX_EMITTER_H */
Index: /trunk/src/lib/particles/dot_emitter.h
===================================================================
--- /trunk/src/lib/particles/dot_emitter.h	(revision 6822)
+++ /trunk/src/lib/particles/dot_emitter.h	(revision 6823)
@@ -8,7 +8,4 @@
 
 #include "particle_emitter.h"
-
-// Default values
-#define DOT_EMITTER_DEFAULT_SIZE              1.0
 
 //! A class to handle an Emitter.
@@ -23,15 +20,8 @@
 
 
-  /* controlling the emitter: interface */
-  void tick(float dt);
-
   virtual void emitParticles(unsigned int count) const;
 
 private:
   void init();
-
-private:
-  Vector          emitterSize;       //!< The size of the emitter (not for EMITTER_DOT).
-
 };
 
Index: /trunk/src/lib/particles/particle_system.cc
===================================================================
--- /trunk/src/lib/particles/particle_system.cc	(revision 6822)
+++ /trunk/src/lib/particles/particle_system.cc	(revision 6823)
@@ -140,11 +140,18 @@
   {
     BaseObject* emitter = Factory::fabricate(element);
-    if (emitter->isA(CL_PARTICLE_EMITTER))
-      this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
+    if (emitter != NULL)
+    {
+      if (emitter->isA(CL_PARTICLE_EMITTER))
+        this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
+      else
+      {
+        PRINTF(2)("Tried to load an Element of type '%s' that should be a ParticleEmitter onto '%s::%s'.\n",
+                  emitter->getClassName(), this->getClassName(), this->getName());
+        delete emitter;
+      }
+    }
     else
     {
-      PRINTF(2)("Tried to load an Element of type '%s' that should be a ParticleEmitter onto '%s::%s'.\n",
-                emitter->getClassName(), this->getClassName(), this->getName());
-      delete emitter;
+      PRINTF(2)("Could not Generate Emitter for system %s::%s (wrong type in XML-format)\n", this->getClassName(), getName());
     }
   }
